12
13
14@receiver(post_save, sender=User)
15def create_profiles(sender, instance, created, **kwargs):16 match created:
17 case True:
18 # statuses
32 users = graphene.List(UserType)
33
34 @staticmethod
35 def resolve_users(info, **kwargs):36 return User.objects.all()
37
38
5
6
7class Command(BaseCommand):
8 def handle(self, *args, **options): 9 if not User.objects.filter(username="admin").exists():
10 User.objects.create_superuser("admin", "[email protected]", "admin")
11 self.stdout.write(self.style.SUCCESS("Successfully created superuser"))
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