Click here to Skip to main content
15,921,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Help!! Pretty new to software development.

I need to show password_set_date within the user object of my app. Currently, when I
(from the front-end) I get something like this:

{id: id, username: username, first_name: first_name, last_name: last_name, date: date}

I need to add a password_set_date field to this user object

password_set_date is not a column in the postgres DB but is returned from LDAP.

I don’t need to modify the authentication.
class User(AbstractUser):
    created_at = models.DateTimeField(auto_now_add=True, null=True)
    modified_at = models.DateTimeField(auto_now=True, null=True)
    source = models.IntegerField(default=int(settings.LOCATION_ID))
    last_login = models.DateTimeField(blank=True, null=True)
class Meta:
        model = User
        fields = [
        ref_name = "SecondUser"
if results:
   res = c.response[0]['attributes']
   user = User.objects.get(username=req['username'])
   user.first_name = res.get('givenName', '')
   user.last_name = res.get('sn', '') = res.get('mail', '')

(results refers to the LDAP query)

Let me know if you need any additional information/code.

Please help!! Really appreciate it!

What I have tried:

Modifying the AbstractUser model, file & file, but I honestly don’t understand them or their relationship.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900