Skip to content

Commit

Permalink
Don't display or accept submissions from deleted profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkcuys committed Oct 10, 2012
1 parent 98694a8 commit 39080e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lernanta/apps/badges/models.py
Expand Up @@ -194,6 +194,8 @@ def can_post_submission(self, user):
return False
if user.is_authenticated():
profile = user.get_profile()
if not profile.can_post():
return False
if not self.is_eligible(profile):
return False
awards = Award.objects.filter(user=profile, badge=self)
Expand Down
4 changes: 2 additions & 2 deletions lernanta/apps/badges/templatetags/badge_tags.py
Expand Up @@ -18,8 +18,8 @@ def give_badge_action(project, peer):

def badge_submissions(request, pending_page_url, awarded_page_url,
mine_page_url, toggled_awards, toggled_mine, badge=None):
pending_submissions = Submission.objects.filter(pending=True)
awarded_submissions = Submission.objects.filter(pending=False)
pending_submissions = Submission.objects.filter(author__deleted=False, pending=True)
awarded_submissions = Submission.objects.filter(author__deleted=False, pending=False)
if badge:
pending_submissions = pending_submissions.filter(badge=badge)
awarded_submissions = awarded_submissions.filter(badge=badge)
Expand Down

0 comments on commit 39080e3

Please sign in to comment.