mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-05-17 19:51:12 +00:00
remove python 2 style codes
This commit is contained in:
parent
b74284fd10
commit
723f804d5f
2 changed files with 3 additions and 3 deletions
|
|
@ -56,7 +56,7 @@ class Admin2UserCreationForm(UserCreationForm):
|
||||||
class Admin2UserChangeForm(UserChangeForm):
|
class Admin2UserChangeForm(UserChangeForm):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(Admin2UserChangeForm, self).__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
print(self.fields['password'].help_text)
|
print(self.fields['password'].help_text)
|
||||||
self.fields['password'].help_text = _("Raw passwords are not stored, so there is no way to see this user's password, but you can change the password using <a href=\"%s\">this form</a>." % self.get_update_password_url())
|
self.fields['password'].help_text = _("Raw passwords are not stored, so there is no way to see this user's password, but you can change the password using <a href=\"%s\">this form</a>." % self.get_update_password_url())
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ def model_permission(permission):
|
||||||
return has_permission
|
return has_permission
|
||||||
|
|
||||||
|
|
||||||
class BasePermission(object):
|
class BasePermission:
|
||||||
'''
|
'''
|
||||||
Provides a base class with a common API. It implements a compatible
|
Provides a base class with a common API. It implements a compatible
|
||||||
interface to django-rest-framework permission backends.
|
interface to django-rest-framework permission backends.
|
||||||
|
|
@ -187,7 +187,7 @@ class ModelDeletePermission(BasePermission):
|
||||||
permissions = (model_permission('{app_label}.delete_{model_name}'),)
|
permissions = (model_permission('{app_label}.delete_{model_name}'),)
|
||||||
|
|
||||||
|
|
||||||
class TemplatePermissionChecker(object):
|
class TemplatePermissionChecker:
|
||||||
'''
|
'''
|
||||||
Can be used in the template like:
|
Can be used in the template like:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue