mirror of
https://github.com/fastogt/fastocloud_admin.git
synced 2025-03-09 23:38:52 +00:00
Review
This commit is contained in:
parent
6bfd6b4774
commit
ca8462b2f1
2 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@ class SubscriberForm(FlaskForm):
|
||||||
AVAILABLE_COUNTRIES = [('UK', 'United kingdom'), ('RU', 'Russian'), ('BY', 'Belarus')]
|
AVAILABLE_COUNTRIES = [('UK', 'United kingdom'), ('RU', 'Russian'), ('BY', 'Belarus')]
|
||||||
email = StringField(lazy_gettext(u'Email:'),
|
email = StringField(lazy_gettext(u'Email:'),
|
||||||
validators=[InputRequired(), Email(message=lazy_gettext(u'Invalid email')), Length(max=30)])
|
validators=[InputRequired(), Email(message=lazy_gettext(u'Invalid email')), Length(max=30)])
|
||||||
password = PasswordField(lazy_gettext(u'Password:'), validators=[InputRequired(), Length(min=6, max=80)])
|
password = PasswordField(lazy_gettext(u'Password:'), validators=[InputRequired(), Length(min=4, max=80)])
|
||||||
country = SelectField(lazy_gettext(u'Locale:'), coerce=str, validators=[InputRequired()],
|
country = SelectField(lazy_gettext(u'Locale:'), coerce=str, validators=[InputRequired()],
|
||||||
choices=AVAILABLE_COUNTRIES)
|
choices=AVAILABLE_COUNTRIES)
|
||||||
apply = SubmitField(lazy_gettext(u'Apply'))
|
apply = SubmitField(lazy_gettext(u'Apply'))
|
||||||
|
|
|
@ -4,7 +4,7 @@ from bson.objectid import ObjectId
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
|
|
||||||
from mongoengine import Document, EmbeddedDocument, StringField, DateTimeField, IntField, ListField, ReferenceField, \
|
from mongoengine import Document, EmbeddedDocument, StringField, DateTimeField, IntField, ListField, ReferenceField, \
|
||||||
PULL, ObjectIdField
|
PULL, ObjectIdField, EmbeddedDocumentField
|
||||||
|
|
||||||
from app.service.service_entry import ServiceSettings
|
from app.service.service_entry import ServiceSettings
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class Subscriber(Document):
|
||||||
type = IntField(default=Type.USER)
|
type = IntField(default=Type.USER)
|
||||||
country = StringField(min_length=2, max_length=3, required=True)
|
country = StringField(min_length=2, max_length=3, required=True)
|
||||||
servers = ListField(ReferenceField(ServiceSettings, reverse_delete_rule=PULL), default=[])
|
servers = ListField(ReferenceField(ServiceSettings, reverse_delete_rule=PULL), default=[])
|
||||||
devices = ListField(Device(), default=[])
|
devices = ListField(EmbeddedDocumentField(Device), default=[])
|
||||||
streams = ListField(ObjectIdField(), default=[])
|
streams = ListField(ObjectIdField(), default=[])
|
||||||
|
|
||||||
def add_server(self, server: ServiceSettings):
|
def add_server(self, server: ServiceSettings):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue