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

Commit 4fa391b

Browse files
committed
remove initially added try excepts
1 parent 744299b commit 4fa391b

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

aldryn_newsblog/models.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,9 @@ def get_absolute_url(self, language=None):
201201
'slug', default=None, language_code=language)
202202
if slug and lang:
203203
site_id = getattr(settings, 'SITE_ID', None)
204-
try:
205-
if get_redirect_on_fallback(language, site_id):
206-
language = lang
207-
kwargs.update(slug=slug)
208-
except:
209-
pass
204+
if get_redirect_on_fallback(language, site_id):
205+
language = lang
206+
kwargs.update(slug=slug)
210207

211208
if self.app_config and self.app_config.namespace:
212209
namespace = '{0}:'.format(self.app_config.namespace)

gsoc/models.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,14 +1634,11 @@ 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-
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
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()
16451642

16461643

16471644
# Add ArticleReveiw object when new Article is created

0 commit comments

Comments
 (0)