74 return self.email
75
76 @staticmethod
77 def has_perm(perm, obj=None): 78 "Does the user have a specific permission?"
79 # Simplest possible answer: Yes, always
80 return True
74 return self.email
75
76 @staticmethod
77 def has_perm(perm, obj=None): 78 "Does the user have a specific permission?"
79 # Simplest possible answer: Yes, always
80 return True
80 return True
81
82 @staticmethod
83 def has_module_perms(app_label): 84 "Does the user have permissions to view the app `app_label`?"
85 # Simplest possible answer: Yes, always
86 return True
128
129
130@receiver(pre_save, sender=NewUserResgistration)
131def revoke_tokens(sender, instance, **kwargs):132 if not instance._state.adding:
133 existing_user = NewUserResgistration.objects.get(pk=instance.pk)
134 if (
78
79
80@shared_task(bind=True)
81def status_update(self):82 pending_task_id = SentMail.objects.filter(status="PENDING")
83
84 for pending_task in pending_task_id:
An unused argument can lead to confusions. It should be removed. If this variable is necessary, name the variable _
or start the name with unused
or _unused
.
def square(x, y=1):
return x * x
class MySubClass(MyClass):
def __init__(self, number):
self.value = 42 # argument `number` remains unused
def square(x):
return x * x
class MySubClass(MyClass):
def __init__(self, _):
self.value = 42