55
56
form = forms.OpportunityForm(data=request.POST, instance=opportunity)
56
57
if form.is_valid():
57
58
if form.cleaned_data["reviewed"] != opportunity.reviewed:
58
models.log_action(request.user.username, action="marked as reviewed",
59
models.log_action(request.user, action="marked as reviewed",
59
60
opportunity=opportunity)
60
61
if form.cleaned_data["applied"] != opportunity.applied:
61
models.log_action(request.user.username, action="marked as applied",
62
models.log_action(request.user, action="marked as applied",
63
opportunity=opportunity)
64
if form.cleaned_data["experience"] != opportunity.experience:
65
models.log_action(request.user,
66
action="changed experience to: %s" % form.cleaned_data["experience"],
62
67
opportunity=opportunity)
63
68
if form.cleaned_data["comment"] != opportunity.comment:
64
models.log_action(request.user.username,
65
action="changed comment to: '%s'" % \
66
form.cleaned_data["comment"],
69
if len(form.cleaned_data["comment"]) > 178:
70
action = "changed comment to: '%s'" % (form.cleaned_data["comment"][:177]+u"…")
72
action = "changed comment to: '%s'" % form.cleaned_data["comment"]
73
models.log_action(request.user, action=action,
67
74
opportunity=opportunity)
69
76
return HttpResponseRedirect(request.POST["next"])