Compare commits
3 Commits
145806b5ce
...
cf544dc596
Author | SHA1 | Date |
---|---|---|
Yohann D'ANELLO | cf544dc596 | |
Yohann D'ANELLO | c0521005ef | |
Yohann D'ANELLO | 09c61091d5 |
|
@ -142,8 +142,8 @@ class BorrowAdmin(VersionAdmin):
|
||||||
|
|
||||||
class GameAdmin(VersionAdmin, PolymorphicChildModelAdmin):
|
class GameAdmin(VersionAdmin, PolymorphicChildModelAdmin):
|
||||||
list_display = ('title', 'owner', 'duration', 'players_min',
|
list_display = ('title', 'owner', 'duration', 'players_min',
|
||||||
'players_max', 'comment')
|
'players_max', 'comment', 'isbn')
|
||||||
search_fields = ('name', 'owner__username', 'duration', 'comment')
|
search_fields = ('isbn', 'title', 'owner__username', 'duration', 'comment')
|
||||||
autocomplete_fields = ('owner',)
|
autocomplete_fields = ('owner',)
|
||||||
show_in_index = True
|
show_in_index = True
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
# Generated by Django 2.2.24 on 2021-11-14 15:24
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('users', '0045_auto_20211114_1423'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='membership',
|
||||||
|
name='date_end',
|
||||||
|
field=models.DateField(verbose_name='start date'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='membership',
|
||||||
|
name='date_start',
|
||||||
|
field=models.DateField(verbose_name='start date'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -59,12 +59,12 @@ class User(AbstractUser):
|
||||||
data : dict
|
data : dict
|
||||||
Dictionary with user data to update.
|
Dictionary with user data to update.
|
||||||
"""
|
"""
|
||||||
self.email = data['email']
|
self.email = data['email'] or ''
|
||||||
self.first_name = data['first_name']
|
self.first_name = data['first_name'] or ''
|
||||||
self.last_name = data['last_name']
|
self.last_name = data['last_name'] or ''
|
||||||
self.phone_number = data['profile']['phone_number']
|
self.phone_number = data['profile']['phone_number'] or ''
|
||||||
self.address = data['profile']['address']
|
self.address = data['profile']['address'] or ''
|
||||||
self.comment = data['profile']['section']
|
self.comment = data['profile']['section'] or ''
|
||||||
|
|
||||||
for membership_dict in data['memberships']:
|
for membership_dict in data['memberships']:
|
||||||
if membership_dict['club'] != 22: # Med
|
if membership_dict['club'] != 22: # Med
|
||||||
|
@ -88,12 +88,10 @@ class Membership(models.Model):
|
||||||
)
|
)
|
||||||
|
|
||||||
date_start = models.DateField(
|
date_start = models.DateField(
|
||||||
auto_now_add=True,
|
|
||||||
verbose_name=_('start date'),
|
verbose_name=_('start date'),
|
||||||
)
|
)
|
||||||
|
|
||||||
date_end = models.DateField(
|
date_end = models.DateField(
|
||||||
auto_now_add=True,
|
|
||||||
verbose_name=_('start date'),
|
verbose_name=_('start date'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue