Commit 94b9be98 authored by Olga Brani's avatar Olga Brani
Browse files

Merge branch 'latest-quota' of https://code.grnet.gr/git/synnefo into latest-quota

parents 859b25f5 94088817
......@@ -46,7 +46,7 @@ if QUOTAHOLDER_URL:
from kamaki.clients.quotaholder import QuotaholderClient
ENTITY_KEY = '1'
PRACTICALLY_INF = pow(2, 30)
PRACTICALLY_INF = pow(2, 70)
inf = float('inf')
......@@ -168,7 +168,7 @@ def qh_add_quota(serial, sub_list, add_list):
context = {}
c = get_client()
sub_quota = []
sub_append = sub_quota.append
add_quota = []
......
......@@ -707,7 +707,7 @@ class ProjectApplicationForm(forms.ModelForm):
homepage = forms.URLField(
label = app_home_label,
help_text = app_home_help,
help_text = app_home_help,
widget = app_home_widget,
required = False)
......@@ -732,12 +732,15 @@ class ProjectApplicationForm(forms.ModelForm):
label = app_end_date_label,
help_text = app_end_date_help)
member_join_policy = forms.ChoiceField(
member_join_policy = forms.TypedChoiceField(
label = join_policy_label,
initial = 2,
coerce = int,
choices = join_policies)
member_leave_policy = forms.ChoiceField(
member_leave_policy = forms.TypedChoiceField(
label = leave_policy_label,
coerce = int,
choices = leave_policies)
limit_on_members_number = forms.IntegerField(
......
......@@ -642,7 +642,7 @@ def update_application(app_id, **kw):
app.issue_date = datetime.now()
resource_policies = kw.pop('resource_policies', None)
for k, v in kw:
for k, v in kw.iteritems():
setattr(app, k, v)
app.save()
app.resource_policies = resource_policies
......
......@@ -51,12 +51,12 @@ class Command(NoArgsCommand):
def handle_noargs(self, **options):
apps = ProjectApplication.objects.select_related().all().order_by('id')
labels = (
'application.id', 'application.state', 'project.id', 'name',
'is_alive', 'is_suspended', 'is_terminated'
'ApplID', 'PrecApplID', 'ApplState', 'ProjectID', 'name',
'ProjectStatus'
)
columns = (15, 10, 20, 10, 10, 10, 10, 10)
columns = (10, 10, 10, 10, 20, 10)
if not options['csv']:
line = ' '.join(l.rjust(w) for l, w in zip(labels, columns))
......@@ -65,24 +65,31 @@ class Command(NoArgsCommand):
self.stdout.write(sep + '\n')
for app in apps:
precursor = app.precursor_application
prec_id = precursor.id if precursor else ''
try:
project_id = str(app.project.id)
is_alive = app.project.is_alive
is_suspended = app.project.is_suspended
is_terminated = app.project.is_terminated
project = app.project
project_id = project.id
if project.is_alive:
status = 'ALIVE'
elif project.is_terminated:
status = 'TERMINATED'
elif project.is_suspended:
status = 'SUSPENDED'
else:
status = 'UNKNOWN'
except:
project_id = ''
is_alive = ''
is_suspended = ''
is_terminated = ''
status = ''
fields = (
str(app.id),
str(prec_id),
app.state,
str(project_id),
app.name,
format_bool(is_alive),
format_bool(is_suspended),
format_bool(is_terminated)
status
)
if options['csv']:
......
......@@ -1158,7 +1158,7 @@ class ProjectApplication(models.Model):
name = models.CharField(max_length=80)
homepage = models.URLField(max_length=255, null=True)
description = models.TextField(null=True, blank=True)
start_date = models.DateTimeField()
start_date = models.DateTimeField(null=True, blank=True)
end_date = models.DateTimeField()
member_join_policy = models.IntegerField()
member_leave_policy = models.IntegerField()
......
......@@ -18,9 +18,10 @@
1. PROJECT DETAILS
<span class="info">
<em>more info</em>
<span> To create a new Project, first enter the following required fields.
The information you enter (except <em>Comments for review)</em>)
will be visible to all ~okeanos users. </span>
<span> To create a new Project, first enter the following
required fields. The information you enter, except
<i>Comments for review</i>, will be visible to all ~okeanos
users. </span>
</span>
</legend>
{% for field in form %}
......
......@@ -37,9 +37,9 @@
<h3>MEMBERSHIP OPTIONS</h3>
<dl class="alt-style">
<dt>Member join policy</dt>
<dd>{{ join_policies|lookup:form_data.member_join_policy }}</dd>
<dd>{{ join_policies|lookup:form_data.member_join_policy|title }}</dd>
<dt>Member leave policy</dt>
<dd>{{ leave_policies|lookup:form_data.member_leave_policy }}</dd>
<dd>{{ leave_policies|lookup:form_data.member_leave_policy|title }}</dd>
<dt>Total number of members</dt>
<dd>{{ form_data.limit_on_members_number }}</dd>
</dl>
......
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