mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 11:23:48 -05:00
Work in progress.
This commit is contained in:
@@ -61,8 +61,10 @@ class UKMobileNumber(StringField):
|
||||
|
||||
if len(self.data) != 9:
|
||||
return
|
||||
|
||||
self.data = '+44 7{} {} {}'.format(*re.findall('...', self.data))
|
||||
# TODO implement in the render field method.
|
||||
# API's require no spaces in the number
|
||||
#self.data = '+44 7{} {} {}'.format(*re.findall('...', self.data))
|
||||
self.data = '+447{}{}{}'.format(*re.findall('...', self.data))
|
||||
|
||||
|
||||
def mobile_number():
|
||||
|
||||
@@ -16,7 +16,7 @@ def add_service():
|
||||
heading = 'Add a new service'
|
||||
if form.validate_on_submit():
|
||||
user = users_dao.get_user_by_id(session['user_id'])
|
||||
service_id = services_dao.insert_new_service(form.name.data, user)
|
||||
service_id = services_dao.insert_new_service(form.name.data, user.id)
|
||||
return redirect(url_for('main.service_dashboard', service_id=service_id))
|
||||
else:
|
||||
return render_template(
|
||||
|
||||
@@ -13,8 +13,8 @@ class NotificationsAdminAPIClient(NotificationsAPIClient):
|
||||
|
||||
def init_app(self, application):
|
||||
self.base_url = application.config['API_HOST_NAME']
|
||||
self.client_id = application.config['NOTIFY_API_CLIENT']
|
||||
self.secret = application.config['NOTIFY_API_SECRET']
|
||||
self.client_id = application.config['ADMIN_CLIENT_USER_NAME']
|
||||
self.secret = application.config['ADMIN_CLIENT_SECRET']
|
||||
|
||||
def create_service(self, service_name, active, limit, restricted, user_id):
|
||||
"""
|
||||
@@ -128,6 +128,8 @@ class NotificationsAdminAPIClient(NotificationsAPIClient):
|
||||
message,
|
||||
job_id=None,
|
||||
description=None):
|
||||
print("{0} {1} {2} {3}".format(
|
||||
mobile_number, message, job_id, description))
|
||||
self.send_sms_notification(mobile_number, message)
|
||||
|
||||
def send_email(self,
|
||||
@@ -137,4 +139,5 @@ class NotificationsAdminAPIClient(NotificationsAPIClient):
|
||||
subject,
|
||||
job_id=None,
|
||||
description=None):
|
||||
pass
|
||||
print("{0} {1} {2} {3} {4} {5}".format(
|
||||
email_address, message, from_address, subject, job_id, description))
|
||||
|
||||
Reference in New Issue
Block a user