Skip to content

Commit

Permalink
add ignore save model error
Browse files Browse the repository at this point in the history
  • Loading branch information
magsyg committed Dec 31, 2023
1 parent 6275384 commit 6c77d27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/root/utils/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def create(self, validated_data: dict) -> CustomBaseModel:
class CustomBaseAdmin(admin.ModelAdmin):
readonly_fields = ['version', 'created_by', 'created_at', 'updated_by', 'updated_at']

def save_model(self, request: HttpRequest, obj, form, change):
def save_model(self, request: HttpRequest, obj, form, change): # mypy: ignore-errors
try:
if not change:
obj.created_by = request.user
Expand All @@ -214,7 +214,7 @@ class CustomBaseModel(FullCleanSaveMixin):
class Meta:
abstract = True

def is_edited(self):
def is_edited(self) -> bool:
return self.updated_at != self.created_at

def save(self, *args: Any, **kwargs: Any) -> None:
Expand Down

0 comments on commit 6c77d27

Please sign in to comment.