Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Fixed the issue where the learnerstate was not init correctly for sum…
Browse files Browse the repository at this point in the history
…it on login
  • Loading branch information
dbreedt committed Aug 19, 2015
1 parent bb5cf51 commit 86b9850
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions oneplus/learn_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def home(request, state, user):
sumit["level"] = _sumit_level.name
else:
learnerstate.sumit_level = 1
learnerstate.sumit_question = 1
learnerstate.save()
_sumit_level = SUMitLevel.objects.get(order=learnerstate.sumit_level)
sumit["url"] = _sumit_level.image.url
Expand Down Expand Up @@ -873,9 +874,6 @@ def sumit(request, state, user):

_learnerstate = LearnerState.objects.filter(participant__id=user["participant_id"]).first()

if _learnerstate is None:
_learnerstate = LearnerState(participant=_participant)

request.session["state"]["next_tasks_today"] = \
EventQuestionAnswer.objects.filter(
event=_sumit,
Expand Down Expand Up @@ -1864,8 +1862,8 @@ def get():
)

def post():
if "issue" in request.POST.keys() and request.POST["issue"] != "" and \
"fix" in request.POST.keys() and request.POST["fix"] != "":
if "issue" in request.POST.keys() and request.POST["issue"] != "" \
and "fix" in request.POST.keys() and request.POST["fix"] != "":
_usr = Learner.objects.get(pk=user["id"])
_issue = request.POST["issue"]
_fix = request.POST["fix"]
Expand Down

0 comments on commit 86b9850

Please sign in to comment.