Commit 91cd8874 authored by Stavros Sachtouris's avatar Stavros Sachtouris

Use ISO8601 date format in Account API requests

parent 6fdf3135
...@@ -375,6 +375,11 @@ class DateArgument(ValueArgument): ...@@ -375,6 +375,11 @@ class DateArgument(ValueArgument):
def value(self): def value(self):
return self.timestamp return self.timestamp
def isoformat(self):
v = getattr(self, '_value', self.default)
return v.isoformat() if v else None
@value.setter @value.setter
def value(self, newvalue): def value(self, newvalue):
self._value = self.format_date(newvalue) if newvalue else self.default self._value = self.format_date(newvalue) if newvalue else self.default
...@@ -619,7 +619,7 @@ _project_specs = """ ...@@ -619,7 +619,7 @@ _project_specs = """
def apply_notification(func): def apply_notification(func):
def wrap(self, *args, **kwargs): def wrap(self, *args, **kwargs):
r = func(self, *args, **kwargs) r = func(self, *args, **kwargs)
self.writeln('Application is submitted successfully') self.error('Application is submitted successfully')
return r return r
return wrap return wrap
...@@ -762,19 +762,18 @@ class project_create(_init_synnefo_astakosclient, _optional_json): ...@@ -762,19 +762,18 @@ class project_create(_init_synnefo_astakosclient, _optional_json):
specs = load(f) specs = load(f)
for key, arg in ( for key, arg in (
('name', self['project_name']), ('name', self['project_name']),
('end_date', self.arguments['end_date'].isoformat),
('start_date', self.arguments['start_date'].isoformat),
('owner', self['owner_uuid']), ('owner', self['owner_uuid']),
('homepage', self['homepage_url']), ('homepage', self['homepage_url']),
('description', self['description']), ('description', self['description']),
('max_members', self['max_members']), ('max_members', self['max_members']),
('private', self['private']), ('private', self['private']),
('start_date', self['start_date']),
('end_date', self['end_date']),
('join_policy', self['join_policy']), ('join_policy', self['join_policy']),
('leave_policy', self['leave_policy']), ('leave_policy', self['leave_policy']),
('resources', self['resource_capacities'])): ('resources', self['resource_capacities'])):
if arg: if arg:
specs[key] = arg specs[key] = arg
self._print(self.client.create_project(specs), self.print_dict) self._print(self.client.create_project(specs), self.print_dict)
def main(self): def main(self):
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