# User authentication in forms

**URL:** https://forum.djangoproject.com/t/user-authentication-in-forms/38964
**Category:** Forms & APIs
**Created:** [February 19, 2025, 7:02pm UTC](https://forum.djangoproject.com/t/user-authentication-in-forms/38964 "2025-02-19T19:02:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![TahaQaiser100](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/tahaqaiser100/32/27000_2.png) [@TahaQaiser100](https://forum.djangoproject.com/u/TahaQaiser100)
#### Post date: [February 19, 2025, 7:02pm UTC](https://forum.djangoproject.com/t/user-authentication-in-forms/38964/1 "2025-02-19T19:02:43Z")

</div>

I have a model:

```auto
class application(models.Model):
    STATUS_CHOICES = [
        ('applied', 'Applied'),
        ('assessment','Assessment'),
        ('interview', 'Interview'),
        ('accepted', 'Accepted'),
    ]
    
    JOB_TYPE = [
        ('entry level', 'Entry Level'),
        ('internship','Internship'),
        ('graduate scheme', 'Graduate Scheme'),
        ('senior', 'Senior'),
    ] 
    job_position = models.CharField(max_length=150)
    company = models.CharField(max_length=150)
    salary = models.IntegerField()
    
    
    status = models.CharField(max_length=15, choices=STATUS_CHOICES)
    job_type = models.CharField(max_length=15, choices=JOB_TYPE)
    user = models.ForeignKey(User, on_delete=models.CASCADE)

```

Lets say I create a form without including the user as a field, how can I say that the user is automatically the user than is logged in ( authenticated ). Do I use `request.user` somewhere?

---

<div class="post-metadata">

### Author: ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)
#### Post date: [February 19, 2025, 8:40pm UTC](https://forum.djangoproject.com/t/user-authentication-in-forms/38964/2 "2025-02-19T20:40:26Z")

</div>

> [@TahaQaiser100](#):
>
> Do I use `request.user` somewhere?

Yes.

See the docs for [The save() method](https://docs.djangoproject.com/en/5.1/topics/forms/modelforms/#the-save-method) for details and an example.
