1
0
Fork 0
mirror of https://github.com/fastogt/fastocloud_admin.git synced 2025-03-09 23:38:52 +00:00
This commit is contained in:
topilski 2019-06-10 08:04:34 -04:00
parent 6bfd6b4774
commit ca8462b2f1
2 changed files with 3 additions and 3 deletions

View file

@ -11,7 +11,7 @@ class SubscriberForm(FlaskForm):
AVAILABLE_COUNTRIES = [('UK', 'United kingdom'), ('RU', 'Russian'), ('BY', 'Belarus')]
email = StringField(lazy_gettext(u'Email:'),
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()],
choices=AVAILABLE_COUNTRIES)
apply = SubmitField(lazy_gettext(u'Apply'))

View file

@ -4,7 +4,7 @@ from bson.objectid import ObjectId
from enum import IntEnum
from mongoengine import Document, EmbeddedDocument, StringField, DateTimeField, IntField, ListField, ReferenceField, \
PULL, ObjectIdField
PULL, ObjectIdField, EmbeddedDocumentField
from app.service.service_entry import ServiceSettings
@ -50,7 +50,7 @@ class Subscriber(Document):
type = IntField(default=Type.USER)
country = StringField(min_length=2, max_length=3, required=True)
servers = ListField(ReferenceField(ServiceSettings, reverse_delete_rule=PULL), default=[])
devices = ListField(Device(), default=[])
devices = ListField(EmbeddedDocumentField(Device), default=[])
streams = ListField(ObjectIdField(), default=[])
def add_server(self, server: ServiceSettings):