Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 9654ce9

Browse files
committed
handle exception
1 parent 4fa391b commit 9654ce9

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

gsoc/models.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,11 +1634,14 @@ def send_comment_notification(sender, instance, **kwargs):
16341634
def decrease_blog_counter(sender, instance, **kwargs):
16351635
if not instance.pk:
16361636
section = instance.app_config
1637-
up = UserProfile.objects.get(app_config=section)
1638-
if up.current_blog_count > 0:
1639-
up.current_blog_count -= 1
1640-
print("Decreasing", up.current_blog_count)
1641-
up.save()
1637+
try:
1638+
up = UserProfile.objects.get(app_config=section)
1639+
if up.current_blog_count > 0:
1640+
up.current_blog_count -= 1
1641+
print("Decreasing", up.current_blog_count)
1642+
up.save()
1643+
except:
1644+
pass
16421645

16431646

16441647
# Add ArticleReveiw object when new Article is created

gsoc/settings.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,5 +577,3 @@ def gettext(s):
577577
DEFAULT_AUTO_FIELD='django.db.models.AutoField'
578578

579579
CSRF_FAILURE_VIEW = 'gsoc.views.csrf_failure'
580-
581-
USE_TZ = True

0 commit comments

Comments
 (0)