-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CW-567] Modifier la génération des fake data afin de s'assurer qu'el…
…les contiennent toujours au moins un admin
- Loading branch information
1 parent
e2d3b0e
commit d27dcbf
Showing
5 changed files
with
11 additions
and
37 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,10 @@ def gen_single_user(n): | |
# This is useful for testing permissions. | ||
cc_account_username = "ccuser%0.2d" % n if not n % 20 == 6 else None | ||
|
||
# One out of 20 of the users will be an admin | ||
# (actually matching student02 in 20 first users). | ||
admin_rights = {"admin_access": True} if n % 20 == 2 else {} | ||
|
||
D_user = { | ||
"mila_email_username": "student%[email protected]" % n, | ||
"status": status, | ||
|
@@ -73,6 +77,7 @@ def gen_single_user(n): | |
"dark_mode": False, | ||
"language": "en" if (n % 2 == 0) else "fr", | ||
}, | ||
**admin_rights, | ||
} | ||
|
||
if cc_account_username is not None: | ||
|
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,4 @@ | ||
# As this folder is used to generate test data, | ||
# Git could ignore everything here, except README file. | ||
* | ||
!README.md |
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 |
---|---|---|
|
@@ -37,7 +37,8 @@ | |
"nbr_items_per_page": 40, | ||
"dark_mode": false, | ||
"language": "en" | ||
} | ||
}, | ||
"admin_access": true | ||
}, | ||
{ | ||
"mila_email_username": "[email protected]", | ||
|