mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-09-18 15:57:44 +02:00
Made Domains/Targets Unique
This commit is contained in:
@@ -23,6 +23,12 @@ class AddTargetForm(forms.Form):
|
||||
}
|
||||
))
|
||||
|
||||
def clean_domain_name(self):
|
||||
data = self.cleaned_data['domain_name']
|
||||
if Domain.objects.filter(domain_name=data).count() > 0:
|
||||
raise forms.ValidationError("{} target/domain already exists".format(data))
|
||||
return data
|
||||
|
||||
|
||||
class UpdateTargetForm(forms.ModelForm):
|
||||
class Meta:
|
||||
|
||||
Reference in New Issue
Block a user