Skip to content
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

Conversation

oleksiyVeretiuk
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 70.027% when pulling 4f69742 on oleksiyVeretiuk:443892497425554_create_blacklist into e5dcf09 on openprocurement:master.

for status in statuses:
status_blacklist[status] = {}
for auth_role in ['lot_owner', 'Administrator', 'convoy', 'concierge']:
status_blacklist[status][auth_role] = []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list comprehension instead.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 70.027% when pulling a843b0a on oleksiyVeretiuk:443892497425554_create_blacklist into e5dcf09 on openprocurement:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 70.027% when pulling 84e85aa on oleksiyVeretiuk:443892497425554_create_blacklist into e5dcf09 on openprocurement:master.

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Напиши цей коментар через '''

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Назва змінної в цьому випадку не відповідає її призначенню. Ти спочатку записуєш в status_blacklist статуси в які можна перейти і називаються вони white_list?

Copy link
Collaborator

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.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 70.027% when pulling 2c8f37b on oleksiyVeretiuk:443892497425554_create_blacklist into e5dcf09 on openprocurement:master.

@yarsanich yarsanich merged commit 41d4288 into openprocurement:master Oct 5, 2017
@oleksiyVeretiuk oleksiyVeretiuk deleted the 443892497425554_create_blacklist branch October 5, 2017 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants