Skip to content

Commit

Permalink
work around missing min and max length fields caused by changing (#88)
Browse files Browse the repository at this point in the history
avatar_source and avatar_license from varchar to text.
once deployed the data can be fixed and this workaround can be removed

Co-authored-by: Martin Bähr <martin@codingforafrica.at>
  • Loading branch information
eMBee and Martin Bähr committed Mar 27, 2024
1 parent 4d4212b commit 85290f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pretalx/orga/forms/cfp.py
Expand Up @@ -75,14 +75,14 @@ def __init__(self, *args, obj, **kwargs):
self.fields[field_name] = forms.IntegerField(
required=False,
min_value=0,
initial=obj.cfp.fields[attribute].get("min_length"),
initial=obj.cfp.fields.get(attribute,{"min_length":None}).get("min_length"),
)
self.fields[field_name].widget.attrs["placeholder"] = ""
field_name = f"cfp_{attribute}_max_length"
self.fields[field_name] = forms.IntegerField(
required=False,
min_value=0,
initial=obj.cfp.fields[attribute].get("max_length"),
initial=obj.cfp.fields.get(attribute,{"max_length":None}).get("max_length"),
)
self.fields[field_name].widget.attrs["placeholder"] = ""
for attribute in self.request_require_fields:
Expand Down

0 comments on commit 85290f2

Please sign in to comment.