Skip to content

Commit

Permalink
update coupon code
Browse files Browse the repository at this point in the history
  • Loading branch information
odenypeter committed Mar 1, 2023
1 parent d1ec617 commit c35b70d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions core/migrations/0016_auto_20230301_1310.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.28 on 2023-03-01 13:10

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('core', '0015_coreuser_coupon'),
]

operations = [
migrations.RenameField(
model_name='coreuser',
old_name='coupon',
new_name='coupon_code',
),
]
2 changes: 1 addition & 1 deletion core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class CoreUser(AbstractUser):
edit_date = models.DateTimeField(null=True, blank=True)
user_type = models.CharField(blank=True, null=True, max_length=50, choices=USER_TYPE_CHOICES, default='Product Team')
survey_status = models.BooleanField(default=False)
coupon = models.CharField(max_length=48, blank=True, null=True)
coupon_code = models.CharField(max_length=48, blank=True, null=True)

class Meta:
ordering = ('first_name',)
Expand Down
2 changes: 1 addition & 1 deletion core/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def create(self, validated_data):

core_groups = validated_data.pop('core_groups', [])
invitation_token = validated_data.pop('invitation_token', None)
coupon_code = validated_data.pop('coupon_code', None)
coupon_code = validated_data.get('coupon_code', None)

# create core user
if settings.AUTO_APPROVE_USER: # If auto-approval set to true
Expand Down

0 comments on commit c35b70d

Please sign in to comment.