diff --git a/apps/authentication/models.py b/apps/authentication/models.py index f41d31f12..e68fb8298 100644 --- a/apps/authentication/models.py +++ b/apps/authentication/models.py @@ -4,6 +4,8 @@ from django.utils.translation import ugettext_lazy as _ from rest_framework.authtoken.models import Token from django.conf import settings +from common.mixins.models import CommonModelMixin + class AccessKey(models.Model): id = models.UUIDField(verbose_name='AccessKeyID', primary_key=True, @@ -32,4 +34,11 @@ class PrivateToken(Token): """Inherit from auth token, otherwise migration is boring""" class Meta: - verbose_name = _('Private Token') \ No newline at end of file + verbose_name = _('Private Token') + + +class LoginConfirmSetting(CommonModelMixin): + user = models.OneToOneField('users.User', on_delete=models.CASCADE, verbose_name=_("User"), related_name=_("login_confirmation_setting")) + reviewers = models.ManyToManyField('users.User', verbose_name=_("Reviewers"), related_name=_("review_login_confirmation_settings")) + is_active = models.BooleanField(default=True, verbose_name=_("Is active")) + diff --git a/apps/orders/__init__.py b/apps/orders/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/apps/orders/admin.py b/apps/orders/admin.py new file mode 100644 index 000000000..8c38f3f3d --- /dev/null +++ b/apps/orders/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/apps/orders/apps.py b/apps/orders/apps.py new file mode 100644 index 000000000..384ab4368 --- /dev/null +++ b/apps/orders/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class OrdersConfig(AppConfig): + name = 'orders' diff --git a/apps/orders/migrations/__init__.py b/apps/orders/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/apps/orders/models.py b/apps/orders/models.py new file mode 100644 index 000000000..d63e7b686 --- /dev/null +++ b/apps/orders/models.py @@ -0,0 +1,23 @@ +from django.db import models +from django.utils.translation import ugettext_lazy as _ + +from common.mixins.models import CommonModelMixin + + +class Order(CommonModelMixin): + STATUS_CHOICES = ( + ('accepted', _("Accepted")), + ('rejected', _("Rejected")), + ('pending', _("Pending")) + ) + TYPE_CHOICES = ( + ('login_request', _("Login request")), + ) + requester = models.ForeignKey('users.User', on_delete=models.SET_NULL, null=True, related_name='orders') + user_name = models.CharField(max_length=128, verbose_name=_("User")) + title = models.CharField(max_length=256, verbose_name=_("Title")) + body = models.TextField(verbose_name=_("Body")) + + type = models.CharField(choices=TYPE_CHOICES, max_length=64) + status = models.CharField(choices=STATUS_CHOICES, max_length=16) + diff --git a/apps/orders/tests.py b/apps/orders/tests.py new file mode 100644 index 000000000..7ce503c2d --- /dev/null +++ b/apps/orders/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/apps/orders/views.py b/apps/orders/views.py new file mode 100644 index 000000000..91ea44a21 --- /dev/null +++ b/apps/orders/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here.