Redirect /tags/abcde to /tag/abcde
This commit is contained in:
		
							parent
							
								
									5ba2ecd38a
								
							
						
					
					
						commit
						fa176fdfb8
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		|  | @ -734,8 +734,8 @@ def get_search_json(): | ||||||
|     return jsonify.make_json_response(search_results) |     return jsonify.make_json_response(search_results) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @site.route('/tag/<specific_tag>') | ||||||
| @site.route('/tags') | @site.route('/tags') | ||||||
| @site.route('/tags/<specific_tag>') |  | ||||||
| @session_manager.give_token | @session_manager.give_token | ||||||
| def get_tags_html(specific_tag=None): | def get_tags_html(specific_tag=None): | ||||||
|     if specific_tag is not None: |     if specific_tag is not None: | ||||||
|  | @ -753,8 +753,8 @@ def get_tags_html(specific_tag=None): | ||||||
|     ) |     ) | ||||||
|     return response |     return response | ||||||
| 
 | 
 | ||||||
|  | @site.route('/tag/<specific_tag>.json') | ||||||
| @site.route('/tags.json') | @site.route('/tags.json') | ||||||
| @site.route('/tags/<specific_tag>.json') |  | ||||||
| @session_manager.give_token | @session_manager.give_token | ||||||
| def get_tags_json(specific_tag=None): | def get_tags_json(specific_tag=None): | ||||||
|     if specific_tag is not None: |     if specific_tag is not None: | ||||||
|  | @ -765,6 +765,11 @@ def get_tags_json(specific_tag=None): | ||||||
|     tags = [etiquette.jsonify.tag(tag, include_synonyms=include_synonyms) for tag in tags] |     tags = [etiquette.jsonify.tag(tag, include_synonyms=include_synonyms) for tag in tags] | ||||||
|     return jsonify.make_json_response(tags) |     return jsonify.make_json_response(tags) | ||||||
| 
 | 
 | ||||||
|  | @site.route('/tags/<specific_tag>') | ||||||
|  | @site.route('/tags/<specific_tag>.json') | ||||||
|  | def get_tags_specific_redirect(specific_tag=None): | ||||||
|  |     return flask.redirect(request.url.replace('/tags/', '/tag/')) | ||||||
|  | 
 | ||||||
| @site.route('/tags/create_tag', methods=['POST']) | @site.route('/tags/create_tag', methods=['POST']) | ||||||
| @decorators.required_fields(['tagname'], forbid_whitespace=True) | @decorators.required_fields(['tagname'], forbid_whitespace=True) | ||||||
| def post_tag_create(): | def post_tag_create(): | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue