Skip to content

Commit 02d0eb6

Browse files
committed
Show user levels as more than numbers in the IESG login table. Add utility methods for use in the admin interface.
- Legacy-Id: 2908
1 parent d3468f4 commit 02d0eb6

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

ietf/ietfauth/models.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from django.db import models
3636
from django.contrib.auth.models import User
3737
from ietf.idtracker.models import PersonOrOrgInfo, IESGLogin
38-
38+
from ietf.utils.admin import admin_link
3939

4040
def find_person(username):
4141
try:
@@ -79,16 +79,24 @@ def __str__(self):
7979
# ietf.idtracker.models.IESGLogin is in the same vein.
8080

8181
class LegacyLiaisonUser(models.Model):
82+
USER_LEVEL_CHOICES = (
83+
(0, 'Secretariat'),
84+
(1, 'IESG'),
85+
(2, 'ex-IESG'),
86+
(3, 'Level 3'),
87+
(4, 'Comment Only(?)'),
88+
)
8289
person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', primary_key=True)
8390
login_name = models.CharField(max_length=255)
84-
password = models.CharField(max_length=25)
85-
user_level = models.IntegerField(null=True, blank=True)
91+
password = models.CharField(max_length=25, blank=True, editable=False)
92+
user_level = models.IntegerField(null=True, blank=True, choices=USER_LEVEL_CHOICES)
8693
comment = models.TextField(blank=True,null=True)
8794
def __str__(self):
8895
return self.login_name
8996
class Meta:
9097
db_table = 'users'
9198
ordering = ['login_name']
99+
person_link = admin_link('person')
92100

93101
class LegacyWgPassword(models.Model):
94102
person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', primary_key=True)
@@ -104,6 +112,7 @@ def __str__(self):
104112
class Meta:
105113
db_table = 'wg_password'
106114
ordering = ['login_name']
115+
person_link = admin_link('person')
107116

108117
# changes done by convert-096.py:changed maxlength to max_length
109118
# removed core

0 commit comments

Comments
 (0)