Commit 1f0f08cc authored by Zenon Mousmoulas's avatar Zenon Mousmoulas

clean up

parent 06588684
......@@ -10,9 +10,11 @@
<hr>
<form method="POST" class="form-horizontal">
{% if form.non_field_errors %}
{% for error in form.non_field_errors %}
<li class="alert-danger"><strong>{{ error }}</strong></li>
{% endfor %}
<ul>
{% for error in form.non_field_errors %}
<li class="alert-danger"><strong>{{ error }}</strong></li>
{% endfor %}
</ul>
{% endif %}
{% csrf_token %}
<div style="display: none">
......
......@@ -240,7 +240,7 @@ class InstServer(models.Model):
acct_port = models.PositiveIntegerField(max_length=5, null=True, blank=True, default=1813, help_text=_("Default for RADIUS: 1813"))
status_server = models.BooleanField(help_text=_("Do you accept Status-Server requests?"))
secret = models.CharField(max_length=80, )
secret = models.CharField(max_length=80)
proto = models.CharField(max_length=12, choices=RADPROTOS, default='radius')
ts = models.DateTimeField(auto_now=True)
......@@ -262,19 +262,18 @@ class InstServer(models.Model):
return self.name
return self.host
# If a server is a proxy to a realm,
# cannot change its type to SP
# If a server is a proxy for a realm, can not change type to SP
def clean(self):
if self.ertype == 2:
realms = InstRealm.objects.filter(proxyto=self)
if realms:
if len(realms) > 0:
text = str()
for realm in realms:
text = text + ' ' + realm.realm
raise ValidationError(
'You cannot change this server to SP (realms "'
+ text + '" use him as a proxy)'
)
'You cannot change this server to SP (it is used by realms %s)' %
', '.join([r.realm for r in realms])
)
class InstRealmMon(models.Model):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment