Commit 167afb774557e74b50dc5c12d9176ab3367ec3d5
1 parent
81a0a945
Exists in
master
and in
5 other branches
ajustes no campo de data de poll #448
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
poll/templates/poll/create.html
... | ... | @@ -91,8 +91,7 @@ |
91 | 91 | <button type="button" id="add" class="btn btn-primary btn-block btn-sm">add</button> |
92 | 92 | <div class="row form-group {% if form.has_error %} has-error {% endif %}"> |
93 | 93 | <label for="{{ form.limit_date.auto_id }}">{{ form.limit_date.label }}</label> |
94 | - {# {% render_field form.limit_date class="form-control" form="form"%} #} | |
95 | - <input form="form" class="form-control date-picker" type="text" name="{{form.limit_date.name}}" {% if form.limit_date.value != None %}value="{{form.limit_date.value|date:'SHORT_DATE_FORMAT'}}"{% endif %}> | |
94 | + <input form="form" class="form-control date-picker" type="text" name="{{form.limit_date.name}}" {% if form.limit_date.value|date:'SHORT_DATE_FORMAT' %}value="{{form.limit_date.value|date:'SHORT_DATE_FORMAT'}}"{% else %} {% if form.limit_date.value != None %}value="{{form.limit_date.value}}"{% endif %}{% endif %}> | |
96 | 95 | {% if form.limit_date.errors %} |
97 | 96 | <div class="not_submited"> |
98 | 97 | </br> | ... | ... |
poll/views.py
... | ... | @@ -236,6 +236,7 @@ class UpdatePoll(LoginRequiredMixin, HasRoleMixin, LogMixin, generic.UpdateView) |
236 | 236 | def get_context_data(self, **kwargs): |
237 | 237 | context = super(UpdatePoll, self).get_context_data(**kwargs) |
238 | 238 | poll = self.object |
239 | + context.get('form').fields.get('students').queryset = poll.topic.subject.students.all() | |
239 | 240 | context['topic'] = poll.topic |
240 | 241 | context['course'] = poll.topic.subject.course |
241 | 242 | context['subject'] = poll.topic.subject | ... | ... |