Skip to content

Commit 82b373a

Browse files
author
Kátia Nakamura
committed
cfp: add tag to the form and downgrade Django==2.0.5
1 parent 0dc6fe7 commit 82b373a

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

pyconbalkan/cfp/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from django import forms
2-
from django.conf import settings
32
from django.forms import ModelForm
43

54
from pyconbalkan.cfp.models import CFPRating
@@ -51,4 +50,5 @@ class Meta:
5150
fields = (
5251
'mark',
5352
'comment',
53+
'tags',
5454
)

pyconbalkan/cfp/templates/cfp_detail.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<div class="cfp">
88
<div class="cfp__content">
9+
<a class="button button--yellow" href="{% url 'cfp_list' %}" role="button">Back to CFP List</a>
910
<h1>{{ cfp.get_type_display }}: {{ cfp.title }} ({% if cfp.duration %}{{ cfp.duration }}{% endif %})</h1>
1011
<h2>by {{ cfp.name }} {% if cfp.company %}({{ cfp.company }}){% endif %}</h2>
1112
<p>Email: {{ cfp.email }}</p>
@@ -28,7 +29,9 @@ <h2 class="success-message">
2829
<input class="button button--blue button--fullwidth mb-xs-40" type="submit" value="Submit" />
2930
</div>
3031
</form>
32+
<a class="button button--yellow" href="{% url 'cfp_list' %}" role="button">Back to CFP List</a>
3133
</div>
3234
</div>
3335

36+
3437
{% endblock %}

pyconbalkan/cfp/views.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,20 @@ def cfp_detail(request, slug):
5757
context = {
5858
'cfp': cfp,
5959
}
60-
6160
initial = {
6261
'user': request.user,
6362
'cfp': cfp
6463
}
65-
6664
try:
6765
rating_instance = CFPRating.objects.get(**initial)
6866
except CFPRating.DoesNotExist:
6967
rating_instance = CFPRating(**initial)
70-
7168
if request.method == 'POST':
7269
form = RateForm(request.POST, instance=rating_instance)
7370
if form.is_valid():
7471
form.save()
72+
context['success'] = 'Your review has been successfully saved.'
7573
else:
7674
form = RateForm(instance=rating_instance)
77-
7875
context['form'] = form
79-
8076
return render(request, 'cfp_detail.html', context)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dj-database-url==0.5.0
22
dj-static==0.0.6
3-
Django==2.1
3+
Django==2.0.5
44
django-choices==1.6.1
55
django-countries==5.3.1
66
django-filter==2.0.0

0 commit comments

Comments
 (0)