Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add required field to user for django admin, add some important model… #1461

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion article/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from django.contrib import admin

from .models import ArticlePage, ArticleAuthorsOrderable
# Register your models here.

admin.site.register(ArticlePage)
5 changes: 5 additions & 0 deletions authors/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.contrib import admin
from .models import AuthorPage
# Register your models here.

admin.site.register(AuthorPage)
4 changes: 4 additions & 0 deletions home/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
from django.contrib import admin
from .models import HomePage, TopArticlesOrderable

# Register your models here.

admin.site.register(HomePage)
admin.site.register(TopArticlesOrderable)
2 changes: 0 additions & 2 deletions magazine/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@

# Register your models here.

admin.site.register(MagazineIssue)
admin.site.register(MagazineSection)
2 changes: 2 additions & 0 deletions section/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from django.contrib import admin
from .models import SectionPage

# Register your models here.
admin.site.register(SectionPage)
5 changes: 5 additions & 0 deletions specialfeaturelanding/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.contrib import admin
from .models import SpecialLandingPage
# Register your models here.

admin.site.register(SpecialLandingPage)
18 changes: 18 additions & 0 deletions users/migrations/0004_user_is_staff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.1 on 2024-05-17 00:05

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('users', '0003_alter_user_id'),
]

operations = [
migrations.AddField(
model_name='user',
name='is_staff',
field=models.BooleanField(default=False),
),
]
1 change: 1 addition & 0 deletions users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class User(AbstractBaseUser, PermissionsMixin):
last_name = CharField(max_length=150, blank=True)

is_active = BooleanField(default=True)
is_staff = BooleanField(default=False)

# Use the email as the username. Users log in with email + password
# instead of username + password.
Expand Down
Loading