mirror of
https://github.com/wger-project/wger.git
synced 2026-02-18 00:17:51 +01:00
Update management commands
The old *args and **options syntax was generating deprecation errors
This commit is contained in:
@@ -58,7 +58,7 @@ class Command(BaseCommand):
|
||||
help = 'Clears the application cache. You *must* pass an option selecting ' \
|
||||
'what exactly you want to clear. See available options.'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
def handle(self, **options):
|
||||
'''
|
||||
Process the options
|
||||
'''
|
||||
|
||||
@@ -28,7 +28,7 @@ class Command(BaseCommand):
|
||||
|
||||
help = 'Deletes all temporary users older than 1 week'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
def handle(self, **options):
|
||||
|
||||
profile_list = UserProfile.objects.filter(is_temporary=True)
|
||||
counter = 0
|
||||
|
||||
@@ -31,7 +31,7 @@ class Command(BaseCommand):
|
||||
|
||||
help = 'Read out all strings that have to be included manually in the .po file'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
def handle(self, **options):
|
||||
|
||||
# Collect all translatable items
|
||||
out = []
|
||||
|
||||
@@ -29,7 +29,7 @@ class Command(BaseCommand):
|
||||
'code used to calculate any of the cached entries is changed and ' \
|
||||
'the ones in the database need to be updated to reflect the new logic.'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
def handle(self, **options):
|
||||
'''
|
||||
Process the options
|
||||
'''
|
||||
|
||||
@@ -26,7 +26,7 @@ class Command(BaseCommand):
|
||||
Sends the prepared mass emails
|
||||
'''
|
||||
|
||||
def handle(self, *args, **options):
|
||||
def handle(self, **options):
|
||||
'''
|
||||
Send some mails and remove them from the list
|
||||
'''
|
||||
|
||||
@@ -53,7 +53,7 @@ class Command(BaseCommand):
|
||||
' their UUID field, if you manually edited or changed it\n'
|
||||
' the script will not be able to match them.')
|
||||
|
||||
def handle(self, *args, **options):
|
||||
def handle(self, **options):
|
||||
|
||||
if not settings.MEDIA_ROOT:
|
||||
raise ImproperlyConfigured('Please set MEDIA_ROOT in your settings file')
|
||||
|
||||
@@ -27,7 +27,7 @@ class Command(BaseCommand):
|
||||
|
||||
help = 'Read out the user submitted exercise'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
def handle(self, **options):
|
||||
|
||||
exercises = Exercise.objects.accepted()
|
||||
usernames = []
|
||||
|
||||
@@ -28,7 +28,7 @@ class Command(BaseCommand):
|
||||
'''
|
||||
help = 'Check that all gym trainers and users have configurations'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
def handle(self, **options):
|
||||
'''
|
||||
Process all users
|
||||
'''
|
||||
|
||||
@@ -34,7 +34,7 @@ class Command(BaseCommand):
|
||||
'''
|
||||
help = 'Send out emails to trainers with users that have not shown recent activity'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
def handle(self, **options):
|
||||
'''
|
||||
Process gyms and send emails
|
||||
'''
|
||||
|
||||
@@ -35,7 +35,7 @@ class Command(BaseCommand):
|
||||
|
||||
help = 'Send out automatic email reminders for workouts'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
def handle(self, **options):
|
||||
'''
|
||||
Find if the currently active workout is overdue
|
||||
'''
|
||||
|
||||
@@ -35,7 +35,7 @@ class Command(BaseCommand):
|
||||
|
||||
help = 'Send out automatic emails to remind the user to enter the weight'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
def handle(self, **options):
|
||||
|
||||
profile_list = UserProfile.objects.filter(num_days_weight_reminder__gt=0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user