Fix "push changes" crash in CommunityAuthSiteAdminForm
authorCélestin Matte <gitlab@cmatte.me>
Thu, 9 Sep 2021 14:50:30 +0000 (16:50 +0200)
committerMagnus Hagander <magnus@hagander.net>
Thu, 9 Sep 2021 14:51:30 +0000 (16:51 +0200)
pgweb/account/admin.py

index d4a3bd04be3518c373a6def3931b425632ad6ca7..7e0e747a87496926e68847ef6010935e417952d3 100644 (file)
@@ -34,7 +34,7 @@ class CommunityAuthSiteAdminForm(forms.ModelForm):
     def clean(self):
         d = super().clean()
 
-        if d.get('push_changes', False) and not d['apiurl']:
+        if d.get('push_changes', False) and not d.get('apiurl', ''):
             self.add_error('push_changes', 'API url must be specified to enable push changes!')
 
         if d.get('push_ssh', False) and not d.get('push_changes', False):