mirror of
https://github.com/OpenBankProject/API-Manager.git
synced 2026-02-06 14:46:45 +00:00
refactor/ date_time saparate fields in Create Customer
This commit is contained in:
parent
3500cc866c
commit
8798910bea
@ -6,6 +6,7 @@ Forms of customers app
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from apimanager.settings import API_FIELD_DATE_FORMAT, API_FIELD_TIME_FORMAT
|
||||
from bootstrap_datepicker_plus import DatePickerInput, DateTimePickerInput
|
||||
from datetime import datetime, timedelta
|
||||
@ -242,6 +243,6 @@ class CreateCustomerForm(forms.Form):
|
||||
return []
|
||||
|
||||
def clean_username(self):
|
||||
self.cleaned_data['user_id'] = self.cleaned_data["username"]
|
||||
self.cleaned_data['user_id'] = self.cleaned_data["user_id"]
|
||||
user_id = self.cleaned_data['user_id']
|
||||
return user_id
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
{% block page_title %}{{ block.super }} / {% trans "Customers" %}{% endblock page_title %}
|
||||
|
||||
|
||||
{% load bootstrap3 %}
|
||||
{% block content %}
|
||||
<div id="customers">
|
||||
|
||||
@ -44,7 +44,6 @@ class CreateView(LoginRequiredMixin, FormView):
|
||||
def form_valid(self, form):
|
||||
date_of_birth_date = form.cleaned_data['date_of_birth_date']
|
||||
date_of_birth_time = form.cleaned_data['date_of_birth_time']
|
||||
print("date_of_birth", dob_date, dob_time)
|
||||
final_date_of_birth = str(date_of_birth_date) + "T" + str(date_of_birth_time) + "Z"
|
||||
form.cleaned_data['date_of_birth'] = final_date_of_birth
|
||||
data = form.cleaned_data
|
||||
|
||||
Loading…
Reference in New Issue
Block a user