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

Refactor how warnings is used int the class Survey #330

Open
ukanga opened this issue Jul 14, 2019 · 0 comments
Open

Refactor how warnings is used int the class Survey #330

ukanga opened this issue Jul 14, 2019 · 0 comments

Comments

@ukanga
Copy link
Contributor

ukanga commented Jul 14, 2019

What is happening now?

Currently, it is passed around as a parameter in some class methods which does not look that clean especially where we depend on the object being updated.

What could make it better?

Use self.warnings.append("A warning message.") instead when added a warning or even self.add_warning("A warning message") with the function handling duplicates.

Implementation plan

It probably starts with a field in SurveyElement.

@@ -60,6 +60,7 @@ class SurveyElement(dict):
         "query": unicode,
         "autoplay": unicode,
         "flat": lambda: False,
+        "warnings": list
     }

     def _default(self):
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

No branches or pull requests

1 participant