Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066416
D7113.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
628 B
Subscribers
None
D7113.diff
View Options
diff --git a/swh/web/auth/mailmap.py b/swh/web/auth/mailmap.py
--- a/swh/web/auth/mailmap.py
+++ b/swh/web/auth/mailmap.py
@@ -57,8 +57,11 @@
UserMailmap.objects.create(
user_id=str(request.user.id), from_email=from_email, **request.data
)
- except IntegrityError:
- return HttpResponseBadRequest("This 'from_email' already exists.")
+ except IntegrityError as e:
+ if "user_mailmap_from_email_key" in e.args[0]:
+ return HttpResponseBadRequest("This 'from_email' already exists.")
+ else:
+ raise
event.successful = True
event.save()
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Nov 5 2024, 8:18 AM (18 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3230032
Attached To
D7113: mailmaps: Avoid false positive when checking IntegrityError.
Event Timeline
Log In to Comment