Commit ddfab2cb authored by David Haynes's avatar David Haynes 🙆
Browse files

Merge branch 'adding-phone-number' into '2.1-dev'

Adding phone number

See merge request !35
parents 50ed6039 e9b0b328
Pipeline #1901 passed with stage
in 1 minute and 34 seconds
Django>=1.11
Django >= 1.11, < 2.0
django-autoslug==1.9.3
django-cas-client==1.3.0
djangorestframework==3.7.0
......
File mode changed from 100644 to 100755
......@@ -29,7 +29,7 @@ class FacilityAdmin(admin.ModelAdmin):
(None, {
'fields': ('facility_name', 'logo', 'facility_category', 'facility_location',
'main_schedule', 'special_schedules',
'facility_product_tags', 'tapingo_url', 'note', 'owners'),
'facility_product_tags', 'tapingo_url','phone_number', 'note', 'owners'),
}),
)
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
api/models.py
......@@ -133,6 +135,13 @@ class Facility(TimeStampedModel):
tapingo_url = models.URLField(blank=True, validators=[RegexValidator(regex='^https:\/\/www.tapingo.com\/',
message='The link is not a valid tapingo link. Example: https://www.tapingo.com/order/restaurant/starbucks-gmu-johnson/',
code='invalid_tapingo_url')])
# Phone number for a location if provided. Accept both ###-###-#### or
# without dashes
phone_number = models.CharField(blank=True, max_length=18, validators=[RegexValidator(regex='^\(?([0-9]{3})\)?[-.●]?([0-9]{3})[-.●]?([0-9]{4})$',
message='Invalid phone number',
code='invalid_phone_number')])
# A comma seperate list of words that neatly an aptly describe the product
# that this facility produces. (ex. for Taco Bell: mexican, taco, cheap)
facility_product_tags = TaggableManager()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment