- Nov 14, 2017
-
-
Benjamin Bertrand authored
ValidationError is catched by default by flask-admin. It's easy to catch in the api/main.py to raise a CSEntryError. We actually don't need to catch ValidationError as it's based on ValueError that we already catch.
-
Benjamin Bertrand authored
Allow to use the same CSEntryError exceptions used for validation in the API and admin views.
-
Benjamin Bertrand authored
Trying to insert an invalid IP or network address raises an exception. This is due to the unique validator from flask-admin that queries the database. The unique validator is automatically added for columns with unique=True. The only way to disable it is to monkey patch the Unique class. This allows the field validator to catch invalid format. IntegrityError are already catched anyway.
-
Benjamin Bertrand authored
- replace TextAreaField by StringField for several Text columns - add filter to replace empty string by None on optional Text and INET fields
-
- Nov 13, 2017
-
-
Benjamin Bertrand authored
-
Benjamin Bertrand authored
Don't override the Admin view __init__ method for consistency. Avoid having to import models in admin/views.py
-
Benjamin Bertrand authored
CIText is displayed as a TextAreaField by flask-admin. Override it to use StringField.
-
- Sep 06, 2017
-
-
Benjamin Bertrand authored
The CIText type is not known by Flask-Admin and was not rendered. A custom model converter is required. See https://github.com/flask-admin/flask-admin/issues/1196
-
Benjamin Bertrand authored
The serial number might not be unique and can't be used as the string to hash. There are for example SD cards that all have the same SN. Using an ICS id allows to pre-print labels that can be assigned to hardware when scanning serial numbers. This id shall be easy to remember (unlike UUID).
-
- Aug 22, 2017
-
-
Benjamin Bertrand authored
User and Group shall not be created locally. They all come from the LDAP/AD server.
-
- Jul 19, 2017
-
-
Benjamin Bertrand authored
The hash is supposed to be computed in the __init__ method of Item. But flask-admin never passes any parameter when creating the model class. The attributes are changed after creation. When creating an item in the admin view, we use the on_model_change method to update the hash. There might be a better way to avoid this code duplication. This works for now.
-
Benjamin Bertrand authored
- restrict admin view to admin users only - the models shall only take optional parameters for flask-admin to work - the models shall implement the __str__ method to be displayed properly in the admin view
-