Archived
misc fixes
This commit is contained in:
1 parent
5fa95c270c
commit
973dc0327b
10 files changed
+14
-17
No files matched your search
@@ -73,7 +73,7 @@ class InsideBackend(object):
|
||||
def _update_user_flags(self):
|
||||
flag_to_group = settings.INSIDE_AUTH_USER_FLAGS_SYNC
|
||||
user_groups = self.user.groups.values_list('name', flat=True)
|
||||
for flag, group in flag_to_group.iteritems():
|
||||
for flag, group in flag_to_group.items():
|
||||
if group in user_groups:
|
||||
setattr(self.user, flag, True)
|
||||
else:
|
||||
|
||||
+1
-1
@@ -137,7 +137,7 @@ def ldap_update_user_details(inside_user, dry_run=False):
|
||||
'full_name': full_name,
|
||||
'display_name': full_name,
|
||||
}
|
||||
for key, value in name_data.iteritems():
|
||||
for key, value in name_data.items():
|
||||
setattr(ldap_user, key, value)
|
||||
|
||||
if not dry_run:
|
||||
|
||||
@@ -57,7 +57,7 @@ class Command(BaseCommand):
|
||||
if self.options['no_prompt']:
|
||||
return True
|
||||
|
||||
val = raw_input('Do you want to permanently remove {} \'{}\'? [y/N]'.format(object_type, username))
|
||||
val = input('Do you want to permanently remove {} \'{}\'? [y/N]'.format(object_type, username))
|
||||
try:
|
||||
confirmed = distutils.util.strtobool(val)
|
||||
except ValueError:
|
||||
|
||||
@@ -102,7 +102,7 @@ class Command(BaseCommand):
|
||||
return ldap_users_diffable
|
||||
|
||||
def sync_users(self, inside_users_diffable, ldap_users_diffable):
|
||||
for username, user in inside_users_diffable.iteritems():
|
||||
for username, user in inside_users_diffable.items():
|
||||
if username not in ldap_users_diffable:
|
||||
# Create
|
||||
create_ldap_user(user, dry_run=self.options['dry_run'])
|
||||
@@ -168,4 +168,4 @@ class Command(BaseCommand):
|
||||
inside_user['username'],
|
||||
','.join(missing_groups)))
|
||||
|
||||
return in_sync
|
||||
return in_sync
|
||||
@@ -24,13 +24,13 @@ class Router(object):
|
||||
return None
|
||||
|
||||
def db_for_read(self, model, **hints):
|
||||
"Point all operations on models connection_name to db=connection_name"
|
||||
"""Point all operations on models connection_name to db=connection_name"""
|
||||
if is_routed_model(model):
|
||||
return model.connection_name
|
||||
return None
|
||||
|
||||
def db_for_write(self, model, **hints):
|
||||
"Point all operations on models connection_name to db=connection_name"
|
||||
"""Point all operations on models connection_name to db=connection_name"""
|
||||
if is_routed_model(model):
|
||||
return model.connection_name
|
||||
return None
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<title>{%block title%}Userinfo{%endblock%}</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}style/stylesheets/screen.css" type="text/css" media="screen, projection" /)>
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}style/stylesheets/screen.css" type="text/css" media="screen, projection" />
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}style/stylesheets/print.css" type="text/css" media="print" />
|
||||
<!--[if lt IE 8]>
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}style/stylesheets/ie.css" type="text/css" media="screen, projection" />
|
||||
|
||||
+3
-3
@@ -11,9 +11,9 @@
|
||||
<div class="nav-collapse">
|
||||
<ul class="nav">
|
||||
{% if active %}
|
||||
<li class="{% if active = "profile" %}active{% endif %}"><a href="/accounts/profile"><i class="icon-home icon-white"></i> Din konto</a></li>
|
||||
<li class="{% if active = "password_change" %}active{% endif %}"><a href="{% url 'django.contrib.auth.views.password_change' %}"><i class="icon-cog icon-white"></i> Endre passord</a></li>
|
||||
<li class="{% if active = "logout" %}active{% endif %}"><a href="{% url 'neuf_userinfo.views.logout' %}">Logg ut</a></li>
|
||||
<li class="{% if active == "profile" %}active{% endif %}"><a href="/accounts/profile"><i class="icon-home icon-white"></i> Din konto</a></li>
|
||||
<li class="{% if active == "password_change" %}active{% endif %}"><a href="{% url 'django.contrib.auth.views.password_change' %}"><i class="icon-cog icon-white"></i> Endre passord</a></li>
|
||||
<li class="{% if active == "logout" %}active{% endif %}"><a href="{% url 'neuf_userinfo.views.logout' %}">Logg ut</a></li>
|
||||
{% if request.user.is_superuser %}
|
||||
<li><a href="/admin">Administrasjon</a></li>
|
||||
{% endif %}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<ul>
|
||||
{% if groups %}
|
||||
{% for group in groups %}
|
||||
{% if group = "dns-aktiv" %}
|
||||
{% if group == "dns-aktiv" %}
|
||||
<li title="Du har tilgang til foreningsmaskinene.">{{ group }}</li>
|
||||
{% else %}
|
||||
<li>{{ group }}</li>
|
||||
|
||||
@@ -24,5 +24,5 @@
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">Logg inn</button>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
@@ -30,6 +30,7 @@ INSTALLED_APPS = (
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'django.contrib.sites',
|
||||
'django_extensions',
|
||||
)
|
||||
INSTALLED_APPS += (
|
||||
@@ -94,10 +95,6 @@ DATABASES = {
|
||||
'USER': 'cn=admin,dc=neuf,dc=no',
|
||||
'PASSWORD': 'toor',
|
||||
},
|
||||
'radius': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': os.path.join(BASE_DIR, 'radius-db.sqlite3'),
|
||||
},
|
||||
'inside': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': os.path.join(BASE_DIR, 'inside-db.sqlite3'),
|
||||
|
||||
Reference in new issue
Block a user