Fixed invite alignment on admin page

Invites and the generate invite form are now displayed as cards. Invite
codes are displayed in a monospace font so they are always aligned with
eachother. The delete button is now inline with the rest of the text.
This commit is contained in:
2020-04-17 15:24:56 +01:00
parent 4df78a22c5
commit dc6a3b9af2
3 changed files with 30 additions and 27 deletions

View File

@@ -92,7 +92,7 @@ def newUser():
validation = validator.validate(data['password'])
valid = True
for criterion in validation:
if validation[criterion] == False:
if validation[criterion] is False:
valid = False
if valid:
log.debug('User password valid')
@@ -170,7 +170,8 @@ def getInvites():
invites = {'invites': []}
response = {'invites': []}
for index, i in enumerate(invites['invites']):
expiry = datetime.datetime.strptime(i['valid_till'], '%Y-%m-%dT%H:%M:%S.%f')
expiry = datetime.datetime.strptime(i['valid_till'],
'%Y-%m-%dT%H:%M:%S.%f')
if current_time >= expiry:
log.debug(('Housekeeping: Deleting old invite ' +
invites['invites'][index]['code']))