Commit aebf1936d2eafa75bcd2f265d2a2477d0f996f3e

Authored by Andrew Buss
1 parent 646e7b1d8d
Exists in master

remove hide_reason from flashcard serializer

Showing 1 changed file with 5 additions and 4 deletions Side-by-side Diff

flashcards/serializers.py View file @ aebf193
... ... @@ -46,19 +46,21 @@
46 46 except User.DoesNotExist:
47 47 raise serializers.ValidationError('Could not verify reset token')
48 48  
  49 +
49 50 class EmailVerificationSerializer(Serializer):
50 51 confirmation_key = CharField()
51 52  
  53 +
52 54 class UserUpdateSerializer(Serializer):
53 55 old_password = CharField(required=False)
54   - new_password = CharField(required=False, allow_blank=False)\
55   - # reset_token = CharField(required=False)
  56 + new_password = CharField(required=False, allow_blank=False)
56 57  
57 58 def validate(self, data):
58 59 if 'new_password' in data and 'old_password' not in data:
59 60 raise serializers.ValidationError('old_password is required to set a new_password')
60 61 return data
61 62  
  63 +
62 64 class LecturePeriodSerializer(ModelSerializer):
63 65 class Meta:
64 66 model = LecturePeriod
... ... @@ -131,7 +133,6 @@
131 133 class FlashcardSerializer(ModelSerializer):
132 134 is_hidden = SerializerMethodField()
133 135 is_in_deck = SerializerMethodField()
134   - # hide_reason = CharField(read_only=True)
135 136 material_week_num = IntegerField(read_only=True)
136 137 material_date = DateTimeField(default=now)
137 138 mask = MaskFieldSerializer(allow_null=True)
... ... @@ -166,7 +167,7 @@
166 167  
167 168 class Meta:
168 169 model = Flashcard
169   - exclude = 'author', 'previous'
  170 + exclude = 'author', 'previous', 'hide_reason'
170 171  
171 172  
172 173 class FlashcardUpdateSerializer(serializers.Serializer):