Skip to content

Commit ec4f153

Browse files
committed
small fix
1 parent 51cea5b commit ec4f153

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

cards/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def get_card_name(self, obj):
4444

4545
class Meta:
4646
model = UserCard
47-
fields = ("id", "card", "card_id", "card_name", "user", "notes", "is_active")
47+
fields = ("id", "card", "card_name", "user", "notes", "is_active")
4848
read_only_fields = ()
4949

5050
validators = [

optimizer/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from cards.models import RewardRule
44

55
# Create your models here.
6-
# This function get card user have(make api call for http://127.0.0.1:8000/api/cards/user-cards/)
6+
# Model to store the user's category selections for the optimizer
77
class UserCategorySelection(models.Model):
88
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name="optimizer_selections")
99
category_tag = models.CharField(max_length=255, choices=RewardRule.CATEGORY_CHOICES)

optimizer/serializers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class Meta:
1010
read_only_fields = ("user",)
1111

1212
def create(self, validated_data):
13-
validated_data['user'] = self.context['request'].user
1413
try:
1514
return super().create(validated_data)
1615
except IntegrityError:

optimizer/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Most of code logic are generated by AI, but with human fix the code and correct logic.
66
# eg, at first the code is calculate the best card for a category from card database,
7-
# but it should be calculate the best card for a category from user's cards.
7+
# but it should calculate the best card for a category from user's cards.
88

99
SELECTED = "SELECTED_CATEGORIES"
1010
BASE_ANYWHERE = "OTHER"

0 commit comments

Comments
 (0)