summaryrefslogtreecommitdiff
path: root/pgcommitfest/commitfest
diff options
context:
space:
mode:
authorMagnus Hagander2019-02-06 18:40:45 +0000
committerMagnus Hagander2019-02-06 19:01:49 +0000
commitb88715934631422b20c56affcb679b901c702a0c (patch)
tree16b39cee57eab9f55ff26c0d0413029728c11b93 /pgcommitfest/commitfest
parent463b3c1fe2e5bea061269ed9eea4b876a9eab213 (diff)
Fix imports and exceptions for Python3
Diffstat (limited to 'pgcommitfest/commitfest')
-rw-r--r--pgcommitfest/commitfest/admin.py2
-rw-r--r--pgcommitfest/commitfest/ajax.py6
-rw-r--r--pgcommitfest/commitfest/forms.py8
-rw-r--r--pgcommitfest/commitfest/management/commands/send_notifications.py2
-rw-r--r--pgcommitfest/commitfest/models.py2
-rw-r--r--pgcommitfest/commitfest/reports.py2
-rw-r--r--pgcommitfest/commitfest/views.py18
7 files changed, 20 insertions, 20 deletions
diff --git a/pgcommitfest/commitfest/admin.py b/pgcommitfest/commitfest/admin.py
index 3ac72a0..a8ac718 100644
--- a/pgcommitfest/commitfest/admin.py
+++ b/pgcommitfest/commitfest/admin.py
@@ -1,6 +1,6 @@
from django.contrib import admin
-from models import *
+from .models import *
class CommitterAdmin(admin.ModelAdmin):
diff --git a/pgcommitfest/commitfest/ajax.py b/pgcommitfest/commitfest/ajax.py
index 71b3ee8..c188684 100644
--- a/pgcommitfest/commitfest/ajax.py
+++ b/pgcommitfest/commitfest/ajax.py
@@ -10,8 +10,8 @@ import requests
import json
from pgcommitfest.auth import user_search
-from models import CommitFest, Patch, MailThread, MailThreadAttachment
-from models import MailThreadAnnotation, PatchHistory
+from .models import CommitFest, Patch, MailThread, MailThreadAttachment
+from .models import MailThreadAnnotation, PatchHistory
class HttpResponseServiceUnavailable(HttpResponse):
@@ -272,5 +272,5 @@ def main(request, command):
resp = HttpResponse(content_type='application/json')
json.dump(_ajax_map[command](request), resp)
return resp
- except Http503, e:
+ except Http503 as e:
return HttpResponseServiceUnavailable(e, content_type='text/plain')
diff --git a/pgcommitfest/commitfest/forms.py b/pgcommitfest/commitfest/forms.py
index ab8a14f..1ab8269 100644
--- a/pgcommitfest/commitfest/forms.py
+++ b/pgcommitfest/commitfest/forms.py
@@ -7,10 +7,10 @@ from django.http import Http404
from selectable.forms.widgets import AutoCompleteSelectMultipleWidget
-from models import Patch, MailThread, PatchOnCommitFest
-from lookups import UserLookup
-from widgets import ThreadPickWidget
-from ajax import _archivesAPI
+from .models import Patch, MailThread, PatchOnCommitFest
+from .lookups import UserLookup
+from .widgets import ThreadPickWidget
+from .ajax import _archivesAPI
class CommitFestFilterForm(forms.Form):
diff --git a/pgcommitfest/commitfest/management/commands/send_notifications.py b/pgcommitfest/commitfest/management/commands/send_notifications.py
index d181712..cb2ef14 100644
--- a/pgcommitfest/commitfest/management/commands/send_notifications.py
+++ b/pgcommitfest/commitfest/management/commands/send_notifications.py
@@ -2,7 +2,7 @@ from django.core.management.base import BaseCommand
from django.db import transaction
from django.conf import settings
-from StringIO import StringIO
+from io import StringIO
from pgcommitfest.commitfest.models import PendingNotification
from pgcommitfest.userprofile.models import UserProfile
diff --git a/pgcommitfest/commitfest/models.py b/pgcommitfest/commitfest/models.py
index 5687561..5a8de34 100644
--- a/pgcommitfest/commitfest/models.py
+++ b/pgcommitfest/commitfest/models.py
@@ -3,7 +3,7 @@ from django.contrib.auth.models import User
from datetime import datetime
-from util import DiffableModel
+from .util import DiffableModel
from pgcommitfest.userprofile.models import UserProfile
diff --git a/pgcommitfest/commitfest/reports.py b/pgcommitfest/commitfest/reports.py
index aae1bba..88f51a9 100644
--- a/pgcommitfest/commitfest/reports.py
+++ b/pgcommitfest/commitfest/reports.py
@@ -4,7 +4,7 @@ from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.db import connection
-from models import CommitFest
+from .models import CommitFest
@login_required
diff --git a/pgcommitfest/commitfest/views.py b/pgcommitfest/commitfest/views.py
index 7835f5e..d8abd55 100644
--- a/pgcommitfest/commitfest/views.py
+++ b/pgcommitfest/commitfest/views.py
@@ -19,12 +19,12 @@ import json
from pgcommitfest.mailqueue.util import send_mail, send_simple_mail
from pgcommitfest.userprofile.util import UserWrapper
-from models import CommitFest, Patch, PatchOnCommitFest, PatchHistory, Committer
-from models import MailThread
-from forms import PatchForm, NewPatchForm, CommentForm, CommitFestFilterForm
-from forms import BulkEmailForm
-from ajax import doAttachThread, refresh_single_thread
-from feeds import ActivityFeed
+from .models import CommitFest, Patch, PatchOnCommitFest, PatchHistory, Committer
+from .models import MailThread
+from .forms import PatchForm, NewPatchForm, CommentForm, CommitFestFilterForm
+from .forms import BulkEmailForm
+from .ajax import doAttachThread, refresh_single_thread
+from .feeds import ActivityFeed
def home(request):
@@ -397,7 +397,7 @@ def comment(request, cfid, patchid, what):
if request.method == 'POST':
try:
form = CommentForm(patch, poc, is_review, data=request.POST)
- except Exception, e:
+ except Exception as e:
messages.add_message(request, messages.ERROR, "Failed to build list of response options from the archives: %s" % e)
return HttpResponseRedirect('/%s/%s/' % (cf.id, patch.id))
@@ -457,7 +457,7 @@ def comment(request, cfid, patchid, what):
else:
try:
form = CommentForm(patch, poc, is_review)
- except Exception, e:
+ except Exception as e:
messages.add_message(request, messages.ERROR, "Failed to build list of response options from the archives: %s" % e)
return HttpResponseRedirect('/%s/%s/' % (cf.id, patch.id))
@@ -742,7 +742,7 @@ def thread_notify(request):
try:
t = MailThread.objects.get(messageid=m)
refresh_single_thread(t)
- except Exception, e:
+ except Exception as e:
# Just ignore it, we'll check again later
pass