1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2024-11-30 10:13:03 +00:00

Fix isbn widget

This commit is contained in:
Alexandre Iooss 2019-08-15 16:30:44 +02:00
parent 626990b119
commit 2a2afb061e
No known key found for this signature in database
GPG Key ID: 6C79278F3FCDCC02
2 changed files with 6 additions and 2 deletions

2
TODO Normal file
View File

@ -0,0 +1,2 @@
régler pq de permission sur app sporz : permettre d'afficher seulement nos gamesave à tout le monde

View File

@ -19,8 +19,10 @@ class EmpruntForm(ModelForm):
class MediaAdminForm(ModelForm): class MediaAdminForm(ModelForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.fields['isbn'].widget.template_name = "media/isbn_button.html" isbn_field = self.fields.get('isbn')
self.fields['isbn'].widget.attrs.update({'autofocus': 'autofocus'}) if isbn_field:
isbn_field.widget.template_name = "media/isbn_button.html"
isbn_field.widget.attrs.update({'autofocus': 'autofocus'})
def download_data(self, isbn): def download_data(self, isbn):
""" """