mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 18:08:21 +02:00
profile picture update view is working
This commit is contained in:
@ -23,15 +23,11 @@ class AliasForm(forms.ModelForm):
|
||||
self.fields["name"].widget.attrs={"placeholder":_('New Alias')}
|
||||
|
||||
|
||||
class ImageForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Note
|
||||
fields = ('display_image',)
|
||||
class ImageForm(forms.Form):
|
||||
image = forms.ImageField(required = False,
|
||||
label=_('select an image'),
|
||||
help_text=_('Maximal size: 2MB'))
|
||||
|
||||
def __init__(self,*args,**kwargs):
|
||||
super().__init__(*args,**kwargs)
|
||||
self.fields["display_image"].label = _("select an image")
|
||||
self.fields["display_image"].widget.attrs={"help_text":_('Maximal size: 2MB')}
|
||||
|
||||
class TransactionTemplateForm(forms.ModelForm):
|
||||
class Meta:
|
||||
|
@ -43,7 +43,8 @@ class Note(PolymorphicModel):
|
||||
display_image = models.ImageField(
|
||||
verbose_name=_('display image'),
|
||||
max_length=255,
|
||||
blank=True,
|
||||
blank=False,
|
||||
null=False,
|
||||
default='pic/default.png'
|
||||
)
|
||||
created_at = models.DateTimeField(
|
||||
|
Reference in New Issue
Block a user