Skip to content
This repository was archived by the owner on Sep 16, 2022. It is now read-only.

Allow users to check off recommended actions they've done#485

Merged
vpetersson merged 5 commits intoWoTTsecurity:masterfrom
GreatFruitOmsk:issue_453
Oct 23, 2019
Merged

Allow users to check off recommended actions they've done#485
vpetersson merged 5 commits intoWoTTsecurity:masterfrom
GreatFruitOmsk:issue_453

Conversation

@rptrchv
Copy link
Contributor

@rptrchv rptrchv commented Oct 23, 2019

Closes #453

@a-martynovich
Copy link
Contributor

Please use Enum with readable names instead of unreadable RECOMMENDED_ACTION_IDS and its indices.

def snooze_action(self, action_id):
snoozed_actions = set(self.snoozed_actions)
snoozed_actions.add(action_id)
self.snoozed_actions = list(snoozed_actions)
Copy link
Contributor

@a-martynovich a-martynovich Oct 23, 2019

Choose a reason for hiding this comment

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

you could simply check if action_id not in self.snoozed_actions

self.title = title
self.description = description
self.actions = actions
self.info = info
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no docstring describing what kind of data should this info field have. Also this name is not informative. And why isn't it two fields (action_id, devices) instead? And is the id field used anywhere?

1. Replaces RECOMMENDED_ACTION_IDS list with an Enum class
2. 'snooze_action' method's code simplified
3. got rid of the 'id' 'Action' class' property
4. renamed the 'info' 'Action' class' property to 'snoozing_info'
@vpetersson vpetersson merged commit e71e122 into WoTTsecurity:master Oct 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow users to check off recommended actions they've done.

4 participants