mirror of https://github.com/jumpserver/jumpserver
[Update] 修改支持工单
parent
cf719f492d
commit
0c1463bc8b
|
@ -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')
|
||||
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"))
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
|
@ -0,0 +1,5 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class OrdersConfig(AppConfig):
|
||||
name = 'orders'
|
|
@ -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)
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
|
@ -0,0 +1,3 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
Loading…
Reference in New Issue