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
Function for creating blacklist from STATUS_CHANGES #20
Function for creating blacklist from STATUS_CHANGES #20
Conversation
openregistry/api/tests/base.py
Outdated
for status in statuses: | ||
status_blacklist[status] = {} | ||
for auth_role in ['lot_owner', 'Administrator', 'convoy', 'concierge']: | ||
status_blacklist[status][auth_role] = [] |
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.
list comprehension instead
.
4f69742
to
a843b0a
Compare
a843b0a
to
84e85aa
Compare
openregistry/api/tests/base.py
Outdated
@@ -33,6 +34,24 @@ def snitch(func): | |||
'test_' + func.func_name, closure=func.func_closure) | |||
|
|||
|
|||
def create_blacklist(status_changes, statuses, roles): | |||
# This cycle generate black list for every status and |
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.
Напиши цей коментар через '''
openregistry/api/tests/base.py
Outdated
if auth_role in status_changes[status]['next_status'][w]] | ||
}) | ||
if auth_role in status_changes[status]['editing_permissions']: | ||
status_blacklist[status][auth_role].append(status) |
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.
Назва змінної в цьому випадку не відповідає її призначенню. Ти спочатку записуєш в status_blacklist
статуси в які можна перейти і називаються вони white_list
?
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.
Краще хай то буде окремий dict
, але називатиметься white_list
. А в кінці statuses
- white_list
.
84e85aa
to
2c8f37b
Compare
No description provided.