3535from django .db import models
3636from django .contrib .auth .models import User
3737from ietf .idtracker .models import PersonOrOrgInfo , IESGLogin
38-
38+ from ietf . utils . admin import admin_link
3939
4040def find_person (username ):
4141 try :
@@ -79,16 +79,24 @@ def __str__(self):
7979# ietf.idtracker.models.IESGLogin is in the same vein.
8080
8181class 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
93101class 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