# Can't Update anything

**URL:** <https://forum.djangoproject.com/t/cant-update-anything/25383>\
**Category:** The Admin\
**Created:** [November 16, 2023, 12:40pm UTC](https://forum.djangoproject.com/t/cant-update-anything/25383 "2023-11-16T12:40:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nimdagh](https://avatars.discourse-cdn.com/v4/letter/n/e274bd/32.png) [@nimdagh](https://forum.djangoproject.com/u/nimdagh)\
**Post date:** [November 16, 2023, 12:40pm UTC](https://forum.djangoproject.com/t/cant-update-anything/25383/1 "2023-11-16T12:40:29Z")

</div>

I can post new jobs but can’t update them even in the admin panel.

 ![admin_not_change](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/2/7/2781478949882c7bfefac09994f1c27e83a30f24.png)

here you see It’s showing in notification that the title changed but it didn’t. If I create new model It works fine though. I guess problem is in my code.

models.py

```python
import random
from modules import files, options
from django.db import models
from ckeditor import fields

# Modules
import random
def customId():
    return str(random.randint(10000000, 99999999))

# Jobs Model
class Job(models.Model):
    jobid = models.SlugField(unique=True, editable=False, verbose_name="JobID")
    title = models.CharField(max_length=250, verbose_name="Job Title")
    country = models.CharField(max_length=250, verbose_name="Country", choices=options.COUNTRIES)
    experience = models.CharField(verbose_name="Experience Range")
    qualification = models.CharField(max_length=250, verbose_name="Qualification Level", choices=options.QUALIFICATION)
    industry = models.CharField(max_length=250, verbose_name="Industry to Hire", choices=options.INDUSTRIES)
    description = fields.RichTextField(max_length=10000, verbose_name="Job Description")
    nationality = models.CharField(max_length=250, verbose_name="JobSeeker Nationality", choices=options.NATIONALITY)
    posted = models.DateTimeField(auto_now_add=True, editable=False)
    keywords = models.CharField(max_length=500, blank=True, default="Jobs, ")

    def save(self):
        if not self.jobid:
            self.jobid = 'JB' + customId()
            super(Job, self).save()

    def __str__ (self):
        return f'{self.title} | ID: {self.jobid}'
    
    class Meta:
        verbose_name = "Vacancy"
        verbose_name_plural = "Vacancies"
        ordering = ('-posted',)

```

admin.py

```python
from django.contrib import admin
from skcdash import models

class JobAdmin(admin.ModelAdmin):
    model = models.Job
    list_display = ['jobid', 'title', 'country']

admin.site.register(models.Job, JobAdmin)

```

Not Updating only in this model I tried creating a new temparary model and that was working fine.

---

<div class="post-metadata">

**Author:** ![addwebsolution](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/addwebsolution/32/23762_2.png) [@addwebsolution](https://forum.djangoproject.com/u/addwebsolution)\
**Post date:** [November 16, 2023, 12:45pm UTC](https://forum.djangoproject.com/t/cant-update-anything/25383/2 "2023-11-16T12:45:03Z")

</div>

> [@nimdagh](#):
>
> ```auto
> def save(self):
> if not self.jobid:
> self.jobid = 'JB' + customId()
> super(Job, self).save()
> 
> ```

remove the indent from `super(Job, self).save()` i.e

```auto
    def save(self):
        if not self.jobid:
            self.jobid = 'JB' + customId()
        super(Job, self).save()

```

---

<div class="post-metadata">

**Author:** ![nimdagh](https://avatars.discourse-cdn.com/v4/letter/n/e274bd/32.png) [@nimdagh](https://forum.djangoproject.com/u/nimdagh)\
**Post date:** [November 16, 2023, 12:48pm UTC](https://forum.djangoproject.com/t/cant-update-anything/25383/3 "2023-11-16T12:48:22Z")

</div>

Thanks It working now 👍
