From 723f804d5fa9927be39ce6f42bbcce77eb0e094e Mon Sep 17 00:00:00 2001 From: Asif Saif Uddin Date: Sun, 17 Oct 2021 15:38:55 +0600 Subject: [PATCH] remove python 2 style codes --- djadmin2/forms.py | 2 +- djadmin2/permissions.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/djadmin2/forms.py b/djadmin2/forms.py index a1b9f66..e3c1c7a 100644 --- a/djadmin2/forms.py +++ b/djadmin2/forms.py @@ -56,7 +56,7 @@ class Admin2UserCreationForm(UserCreationForm): class Admin2UserChangeForm(UserChangeForm): def __init__(self, *args, **kwargs): - super(Admin2UserChangeForm, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) 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 this form." % self.get_update_password_url()) diff --git a/djadmin2/permissions.py b/djadmin2/permissions.py index fbeb00b..f2c83c6 100644 --- a/djadmin2/permissions.py +++ b/djadmin2/permissions.py @@ -91,7 +91,7 @@ def model_permission(permission): return has_permission -class BasePermission(object): +class BasePermission: ''' Provides a base class with a common API. It implements a compatible interface to django-rest-framework permission backends. @@ -187,7 +187,7 @@ class ModelDeletePermission(BasePermission): permissions = (model_permission('{app_label}.delete_{model_name}'),) -class TemplatePermissionChecker(object): +class TemplatePermissionChecker: ''' Can be used in the template like: