I agree, though the code I wrote is consistent with the code in the rest of the view. A follow up bug can be filed to resolve the code smell at a later date.
On Aug 16, 2013, at 4:15 PM, Paul McLanahan <notifications@github.com> wrote:

> In apps/api/views.py:
> 
> > @@ -357,6 +357,44 @@ def location_delete(request):
> >      return xml.success('Deleted location: %s' % location)
> >  
> >  
> > +@require_POST
> > +@csrf_exempt
> > +@has_perm_or_basicauth("mirror.create_update_alias", HTTP_AUTH_REALM)
> > +def create_update_alias(request):
> > +    """Create or update an alias for a product"""
> > +    xml = XMLRenderer()
> > +    
> > +    alias = request.POST.get('alias', None)
> > +    redirect = request.POST.get('related_product', None)
> > +    if not alias:
> > +        return xml.error('alias name is required.', errno=101)
> I 2nd this. Something like:
> 
> class ERRORS:
>     alias_required = 101
>     product_required = 102
>     product_invalid = 103
>     alias_invalid = 104
> Or go even simpler and make them all constants:
> 
> E_ALIAS_REQUIRED = 101
> E_PRODUCT_REQUIRED = 102
> ...
> —
> Reply to this email directly or view it on GitHub.
>