Skip to content

Commit 1569200

Browse files
committed
add status back into dataset form
1 parent 69f22a0 commit 1569200

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

gateway/sds_gateway/users/forms.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from django.utils.translation import gettext_lazy as _
1515
from loguru import logger
1616

17+
from sds_gateway.api_methods.models import Dataset
1718
from sds_gateway.api_methods.models import File
1819

1920
from .models import User
@@ -167,6 +168,12 @@ class DatasetInfoForm(forms.Form):
167168
"Add authors to the dataset. The first author should be the primary author."
168169
),
169170
)
171+
status = forms.ChoiceField(
172+
label="Status",
173+
required=False,
174+
choices=[],
175+
widget=forms.Select(attrs={"class": "form-select d-none"}),
176+
)
170177
is_public = forms.BooleanField(
171178
label="Is Public",
172179
required=False,
@@ -178,6 +185,7 @@ def __init__(self, *args, **kwargs):
178185
user = kwargs.pop("user", None)
179186
self.dataset_uuid = kwargs.pop("dataset_uuid", None)
180187
super().__init__(*args, **kwargs)
188+
self.fields["status"].choices = Dataset.STATUS_CHOICES
181189
initial_authors = self.initial.get("authors")
182190
# Check if authors is empty (None, empty string, or "[]")
183191
is_authors_empty = not initial_authors or initial_authors in ["", "[]"]

0 commit comments

Comments
 (0)