-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes AAP-28034: **Changes Made:** - Added a `get_next_authenticator_order` function to find the next order value, which is equals to `max(order) + 1` - Added unit test **Testing Steps:** 1. Create a new authenticator, and confirm the followings: - If given an order, the created authenticator's order = given order value - If no order was given, the created authenticator's order = max(order) + 1 2. Update/ Delete the order of the current authenticators 3. Back to step 1 and confirm the authenticator order is as expected --------- Co-authored-by: Truc Duong <[email protected]> Co-authored-by: Rick Elrod <[email protected]>
- Loading branch information
1 parent
fc527d3
commit d357157
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
ansible_base/authentication/migrations/0013_alter_authenticator_order.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 4.2.11 on 2024-07-31 20:25 | ||
|
||
import ansible_base.authentication.models.authenticator | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('dab_authentication', '0012_alter_authenticatormap_map_type'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='authenticator', | ||
name='order', | ||
field=models.IntegerField(default=ansible_base.authentication.models.authenticator.get_next_authenticator_order, help_text='The order in which an authenticator will be tried. This only pertains to username/password authenticators'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters