diff options
author | Magnus Hagander | 2016-01-06 15:34:50 +0000 |
---|---|---|
committer | Magnus Hagander | 2016-01-06 15:34:50 +0000 |
commit | 3b5540351321454add1dc4b13d0f75422965e5b2 (patch) | |
tree | d20d64596ea417b234cd8e34f1cfddcf4121a8fb | |
parent | 2e79697f654ed8dd930b881d40b5f1f7e64fe1b5 (diff) |
Replace on_success_commit with atomic
-rw-r--r-- | pgcommitfest/commitfest/ajax.py | 8 | ||||
-rw-r--r-- | pgcommitfest/commitfest/views.py | 16 | ||||
-rw-r--r-- | pgcommitfest/userprofile/views.py | 6 |
3 files changed, 15 insertions, 15 deletions
diff --git a/pgcommitfest/commitfest/ajax.py b/pgcommitfest/commitfest/ajax.py index 1adf0d0..96ae7b0 100644 --- a/pgcommitfest/commitfest/ajax.py +++ b/pgcommitfest/commitfest/ajax.py @@ -73,7 +73,7 @@ def getMessages(request): r = _archivesAPI('/message-id.json/%s' % thread.messageid) return sorted(r, key=lambda x: x['date'], reverse=True) [email protected]_on_success def annotateMessage(request): thread = get_object_or_404(MailThread, pk=int(request.POST['t'])) msgid = request.POST['msgid'] @@ -102,7 +102,7 @@ def annotateMessage(request): return 'OK' return 'Message not found in thread!' [email protected]_on_success def deleteAnnotation(request): annotation = get_object_or_404(MailThreadAnnotation, pk=request.POST['id']) @@ -132,7 +132,7 @@ def parse_and_add_attachments(threadinfo, mailthread): # In theory we should remove objects if they don't have an # attachment, but how could that ever happen? Ignore for now. [email protected]_on_success def attachThread(request): cf = get_object_or_404(CommitFest, pk=int(request.POST['cf'])) patch = get_object_or_404(Patch, pk=int(request.POST['p']), commitfests=cf) @@ -185,7 +185,7 @@ def doAttachThread(cf, patch, msgid, user): return 'OK' [email protected]_on_success def detachThread(request): cf = get_object_or_404(CommitFest, pk=int(request.POST['cf'])) patch = get_object_or_404(Patch, pk=int(request.POST['p']), commitfests=cf) diff --git a/pgcommitfest/commitfest/views.py b/pgcommitfest/commitfest/views.py index f2e54d2..b4f19b2 100644 --- a/pgcommitfest/commitfest/views.py +++ b/pgcommitfest/commitfest/views.py @@ -228,7 +228,7 @@ def patch(request, cfid, patchid): }, context_instance=RequestContext(request)) @login_required [email protected]_on_success def patchform(request, cfid, patchid): cf = get_object_or_404(CommitFest, pk=cfid) patch = get_object_or_404(Patch, pk=patchid, commitfests=cf) @@ -262,7 +262,7 @@ def patchform(request, cfid, patchid): }, context_instance=RequestContext(request)) @login_required [email protected]_on_success def newpatch(request, cfid): cf = get_object_or_404(CommitFest, pk=cfid) if not cf.status == CommitFest.STATUS_OPEN and not request.user.is_staff: @@ -312,7 +312,7 @@ def _review_status_string(reviewstatus): return "not tested" @login_required [email protected]_on_success def comment(request, cfid, patchid, what): cf = get_object_or_404(CommitFest, pk=cfid) patch = get_object_or_404(Patch, pk=patchid) @@ -396,7 +396,7 @@ def comment(request, cfid, patchid, what): }, context_instance=RequestContext(request)) @login_required [email protected]_on_success def status(request, cfid, patchid, status): poc = get_object_or_404(PatchOnCommitFest.objects.select_related(), commitfest__id=cfid, patch__id=patchid) @@ -431,7 +431,7 @@ def status(request, cfid, patchid, status): @login_required [email protected]_on_success def close(request, cfid, patchid, status): poc = get_object_or_404(PatchOnCommitFest.objects.select_related(), commitfest__id=cfid, patch__id=patchid) @@ -504,7 +504,7 @@ def close(request, cfid, patchid, status): return HttpResponseRedirect('/%s/%s/' % (poc.commitfest.id, poc.patch.id)) @login_required [email protected]_on_success def reviewer(request, cfid, patchid, status): get_object_or_404(CommitFest, pk=cfid) patch = get_object_or_404(Patch, pk=patchid) @@ -522,7 +522,7 @@ def reviewer(request, cfid, patchid, status): return HttpResponseRedirect('../../') @login_required [email protected]_on_success def committer(request, cfid, patchid, status): get_object_or_404(CommitFest, pk=cfid) patch = get_object_or_404(Patch, pk=patchid) @@ -546,7 +546,7 @@ def committer(request, cfid, patchid, status): return HttpResponseRedirect('../../') @login_required [email protected]_on_success def send_email(request, cfid): cf = get_object_or_404(CommitFest, pk=cfid) if not request.user.is_staff: diff --git a/pgcommitfest/userprofile/views.py b/pgcommitfest/userprofile/views.py index 75e84c8..7dac00c 100644 --- a/pgcommitfest/userprofile/views.py +++ b/pgcommitfest/userprofile/views.py @@ -15,7 +15,7 @@ from forms import UserProfileForm, MailForm from util import generate_random_token @login_required [email protected]_on_success def userprofile(request): (profile, created) = UserProfile.objects.get_or_create(user=request.user) form = mailform = None @@ -62,7 +62,7 @@ def userprofile(request): }, context_instance=RequestContext(request)) @login_required [email protected]_on_success def deletemail(request): try: id = int(request.META['QUERY_STRING']) @@ -81,7 +81,7 @@ def deletemail(request): return HttpResponseRedirect('../') @login_required [email protected]_on_success def confirmemail(request, tokenhash): try: e = UserExtraEmail.objects.get(user=request.user, token=tokenhash) |