-
-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues/525 fix management command inconsistency #527
base: master
Are you sure you want to change the base?
Changes from 4 commits
5ea9ee8
979e88a
50667f6
5283833
c755252
27f23d4
a9af7a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,9 +43,9 @@ def deactivate_expired_users(): | |
|
||
|
||
@shared_task | ||
def delete_old_radiusbatch_users(older_than_months=12): | ||
def delete_old_radiusbatch_users(older_than_days=365): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't the default here be the same as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure we can change this |
||
management.call_command( | ||
'delete_old_radiusbatch_users', older_than_months=older_than_months | ||
'delete_old_radiusbatch_users', older_than_days=older_than_days | ||
) | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,7 +174,7 @@ def test_delete_old_radiusbatch_users_command(self): | |
self.assertEqual(get_user_model().objects.all().count(), 6) | ||
call_command('delete_old_radiusbatch_users') | ||
self.assertEqual(get_user_model().objects.all().count(), 3) | ||
call_command('delete_old_radiusbatch_users', older_than_months=12) | ||
call_command('delete_old_radiusbatch_users', older_than_days=365) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need a test that ensures the old behavior continues to work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure I can add some more users to test. |
||
self.assertEqual(get_user_model().objects.all().count(), 0) | ||
|
||
@capture_stdout() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we update the default so that it's used only on the new argument? The default for this old argument should be
None
, so that the new argument will be used by default.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this could be done but the action would be same if no argument is provided that is why I did not changed it.I can do this in the next commit.