Skip to content

Commit

Permalink
Merge pull request #187 from Cal-CS-61A-Staff/submission_check
Browse files Browse the repository at this point in the history
Submission check.
  • Loading branch information
sharadmv committed Sep 16, 2014
2 parents d150b37 + 51e9fd9 commit a0ca1a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def put(self, *args, **kwds):
pass


AnonymousUser = AnonymousUser()
AnonymousUser = AnonymousUser.get_or_insert("anon_user")


class Assignment(Base):
Expand Down Expand Up @@ -278,6 +278,9 @@ def _can(cls, user, need, obj=None, query=None):
return user.logged_in

if action == "index":
if not user.logged_in:
return False

if not query:
raise ValueError(
"Need query instance for Submission index action")
Expand Down

0 comments on commit a0ca1a3

Please sign in to comment.