Commit fdb10e7c authored by Dom Sekotill's avatar Dom Sekotill
Browse files

started a new app at kodo_sso.custom_auth

The new app contains models for working with the current authentication
database present for the mail servers at kodo.org.uk
parent 011bb37a
Loading
Loading
Loading
Loading
+0 −0

Empty file added.

+6 −0
Original line number Diff line number Diff line
from . import models

from django.contrib.admin.sites import site
from django.contrib.auth import admin as auth_admin

site.register((models.User,), admin_class=auth_admin.UserAdmin)
+30 −0
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-23 19:07
from __future__ import unicode_literals

import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

	initial = True

	operations = [
		migrations.CreateModel(
			name='BaseUser',
			fields=[
				('password', models.CharField(max_length=255, verbose_name='password')),
				('pkid', models.AutoField(primary_key=True, serialize=False)),
				('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. Minimum of 3 characters, maximum of 100. No spaces.', max_length=100, unique=True, validators=[django.core.validators.RegexValidator('^\\S{3,}$', 'Please enter a valid username. It must contain between 3 and 100 characters and may not contains spaces.')], verbose_name='username')),
				('mailbox', models.CharField(max_length=64, verbose_name='mailbox')),
				('is_active', models.BooleanField(db_column='enabled', default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
			],
			options={
				'db_table': 'users',
			},
		),
	]
+38 −0
Original line number Diff line number Diff line
from __future__ import unicode_literals

import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

	initial = True

	dependencies = [
		('custom_auth', '0001_initial'),
	]

	operations = [
		migrations.AddField(
			model_name='BaseUser',
			name='last_login',
			field=models.DateTimeField(
				blank=True,
				null=True,
				verbose_name='last login'
			),
		),
		migrations.AlterField(
			model_name='BaseUser',
			name='password',
			field=models.CharField(max_length=128, verbose_name='password'),
		),
		migrations.AlterField(
			model_name='BaseUser',
			name='username',
			field=models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. Minimum of 3 characters, maximum of 100. No spaces.', max_length=100, unique=True, validators=[django.core.validators.RegexValidator('^\\S{3,}$', 'Please enter a valid username. It must contain between 3 and 100 characters and may not contains spaces.')], verbose_name='username'),
		),
	]
+45 −0
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-23 19:07
from __future__ import unicode_literals

import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

	dependencies = [
		('custom_auth', '0002_alter_users'),
		('auth', '0007_alter_validators_add_error_messages'),
	]

	run_before = [
		('admin', '0001_initial'),
	]

	operations = [
		migrations.CreateModel(
			name='User',
			fields=[
				('baseuser_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='custom_auth.BaseUser')),
				('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
				('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
				('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
				('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
				('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
				('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
				('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
				('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
			],
			options={
				'swappable': 'AUTH_USER_MODEL',
			},
			bases=('custom_auth.baseuser', models.Model),
			managers=[
				('objects', django.contrib.auth.models.UserManager()),
			],
		),
	]
Loading