Some bug fixes

This commit is contained in:
Skia
2016-09-01 10:00:31 +02:00
parent 1f31d3b56f
commit a4c5d48159
3 changed files with 4 additions and 4 deletions

View File

@ -97,7 +97,7 @@ class Product(models.Model):
"""
Method to see if that object can be edited by the given user
"""
if user.is_in_group(settings.SITH_GROUPS['accounting-admin']['name']):
if user.is_in_group(settings.SITH_GROUPS['accounting-admin']['name']) or user.is_in_group(settings.SITH_GROUPS['counter-admin']['name']):
return True
return False

View File

@ -42,7 +42,7 @@ class GetUserForm(forms.Form):
cleaned_data = super(GetUserForm, self).clean()
cus = None
if cleaned_data['code'] != "":
cus = Customer.objects.filter(account_id=cleaned_data['code']).first()
cus = Customer.objects.filter(account_id__iexact=cleaned_data['code']).first()
elif cleaned_data['id'] is not None:
cus = Customer.objects.filter(user=cleaned_data['id']).first()
sub = get_subscriber(cus.user) if cus is not None else None