Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.
/ pulp Public archive

Commit

Permalink
Add unique index for login
Browse files Browse the repository at this point in the history
  • Loading branch information
goosemania committed Feb 25, 2019
1 parent 8f968b5 commit 0afb65c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/pulp/server/db/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def ensure_database_indexes():
model.LazyCatalogEntry.ensure_indexes()
model.DeferredDownload.ensure_indexes()
model.Distributor.ensure_indexes()
model.User.ensure_indexes()

# Load all the model classes that the server knows about and ensure their indexes as well
plugin_manager = PluginManager()
Expand Down
2 changes: 1 addition & 1 deletion server/pulp/server/db/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ class User(AutoRetryDocument):
:type _ns: mongoengine.StringField
"""

login = StringField(required=True, regex=r'^[.@\-_A-Za-z0-9]+$')
login = StringField(required=True, unique=True, regex=r'^[.@\-_A-Za-z0-9]+$')
name = StringField()
password = StringField()
roles = ListField(StringField())
Expand Down

0 comments on commit 0afb65c

Please sign in to comment.