git://git.onelab.eu
/
plstackapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
create default networks in model policy instead of admin
[plstackapi.git]
/
planetstack
/
core
/
admin.py
diff --git
a/planetstack/core/admin.py
b/planetstack/core/admin.py
index
a2c76e2
..
d2a9b53
100644
(file)
--- a/
planetstack/core/admin.py
+++ b/
planetstack/core/admin.py
@@
-727,8
+727,10
@@
class SliceForm(forms.ModelForm):
def clean(self):
cleaned_data = super(SliceForm, self).clean()
name = cleaned_data.get('name')
def clean(self):
cleaned_data = super(SliceForm, self).clean()
name = cleaned_data.get('name')
- site_id = cleaned_data.get('site')
- site = Slice.objects.get(id=site_id)
+ site = cleaned_data.get('site')
+ if (not isinstance(site,Site)):
+ # previous code indicates 'site' could be a site_id and not a site?
+ site = Slice.objects.get(id=site.id)
if not name.startswith(site.login_base):
raise forms.ValidationError('slice name must begin with %s' % site.login_base)
return cleaned_data
if not name.startswith(site.login_base):
raise forms.ValidationError('slice name must begin with %s' % site.login_base)
return cleaned_data