Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Feature/session question unique key work around #119

Merged
merged 10 commits into from
Aug 3, 2018

Conversation

moh-moola
Copy link
Contributor

No description provided.

Copy link
Contributor

@KaitCrawford KaitCrawford left a comment

Choose a reason for hiding this comment

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

Good job @moh-moola
I've just got some questions

@@ -82,8 +82,11 @@ class Meta:

@property
def clean_name(self):
return str(slugify(text_type(unidecode(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we remove this whole method? Since you added it in your original PR and the base class does it like this?

self.new_answers.update({
checkbox.clean_name: 'off'
for checkbox in self.pk_cleaned_missing_checkboxes
})
Copy link
Contributor

Choose a reason for hiding this comment

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

@moh-moola Doesn't the above code mean that we're adding the missing checkboxes twice? Once with their clean_name and once with their pk_clean_name
And how does this affect checkboxes that were answered? because wouldn't that exist with their clean_name but not with their pk_clean_name and so we'll add conflicting information? Or will they get added before this?

@@ -20,6 +20,17 @@
CHARACTER_COUNT_CHOICE_LIMIT = 512


class SurveyBaseForm(BaseForm):

def pk_cleaned_data(self, fields):
Copy link
Contributor

Choose a reason for hiding this comment

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

Would we be able to put this in the survey model? We could use the get_fields method and pass in the cleaned_data
That way you wouldn't have to overwrite the form class. Or am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@KaitCrawford I am not sure how you mean by this, but I have since tried to clean up the code

@moh-moola
Copy link
Contributor Author

@KaitCrawford Please review, I have implemented your suggested changes and all seems to be well

Copy link
Contributor

@KaitCrawford KaitCrawford left a comment

Choose a reason for hiding this comment

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

👍

@KaitCrawford KaitCrawford merged commit 01a2d13 into develop Aug 3, 2018
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.

2 participants