Skip to content

Commit

Permalink
Force user to manually choose a section for submission. ...
Browse files Browse the repository at this point in the history
This should prevent accidental assignment to whichever section is loaded
first.
  • Loading branch information
sjuxax committed Aug 26, 2013
1 parent c709d4c commit 56b9f8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions raggregate/templates/base/new_post.mak
Expand Up @@ -7,6 +7,7 @@
Description: <textarea name="description" cols="50" rows="10"></textarea><br />
URL: <input type="text" name="url" value="${new_url_text}" /><br />
Section: <select name="section_id">
<option value="">&lt;choose a section&gt;</option>
% for section in sections:
% if 'section' in request.session['safe_get'] and section.name == request.session['safe_get']['section']:
<option value="${section.id}" selected="selected">${section.name}</option>
Expand Down
2 changes: 2 additions & 0 deletions raggregate/views/submission.py
Expand Up @@ -62,6 +62,8 @@ def submit(request):
if 'logged_in' not in s:
s['message'] = 'Sorry, please log in first'
return {'stories': [], 'success': False, 'code': 'ENOLOGIN'}
if 'section' not in p or p['section'] == '':
return {'stories': [], 'success': False, 'code': 'ENOSECTION'}
if 'url' in p and p['url'] != '' and p['url'] is not None:
p['url'] = general.strip_all_html(p['url'])
if not re.match(r'http[s]*:\/\/', p['url']):
Expand Down

0 comments on commit 56b9f8f

Please sign in to comment.