Skip to content

Commit

Permalink
fixed conditional statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Geeker1 authored and milafrerichs committed May 11, 2021
1 parent 0705772 commit 5bbf7b9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions wazimap_ng/datasets/admin/forms/dataset_admin_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ def clean(self):
profile = cleaned_data.get('profile', None)
permission_type = cleaned_data.get('permission_type', None)

if not profile:
if permission_type == 'private':
raise forms.ValidationError('Profile should be set for private permissions.')
if permission_type == 'private' and profile is None:
raise forms.ValidationError('Profile should be set for private permissions.')
return cleaned_data

def __init__(self, *args, **kwargs):
Expand Down

0 comments on commit 5bbf7b9

Please sign in to comment.