Commit 6480122e authored by Giorgos Korfiatis's avatar Giorgos Korfiatis

Preserve owner info when modifying project

An admin can modify a project, i.e. create an application based on
a previous application. We distinguish the initial applicant, called
the `owner', from the user who submitted the current application,
called the `applicant'.

Show owner instead of applicant in project-list: the applicant can
vary among applications for a single project, but owner is likely
to be unique.
parent 6fb1261c
......@@ -881,7 +881,8 @@ class ProjectApplicationForm(forms.ModelForm):
def save(self, commit=True):
data = dict(self.cleaned_data)
data['precursor_application'] = self.instance.id
data['owner'] = self.user
is_new = self.instance.id is None
data['owner'] = self.user if is_new else self.instance.owner
data['resource_policies'] = self.resource_policies
submit_application(data, request_user=self.user)
......
......@@ -133,7 +133,7 @@ class Command(NoArgsCommand):
self.show(csv, allow_shorten, chain_dict)
def show(self, csv, allow_shorten, chain_dict):
labels = ('ProjID', 'Name', 'Applicant', 'Email', 'Status', 'AppID')
labels = ('ProjID', 'Name', 'Owner', 'Email', 'Status', 'AppID')
columns = (7, 23, 20, 20, 17, 7)
if not csv:
......@@ -147,7 +147,7 @@ class Command(NoArgsCommand):
fields = [
(info['projectid'], False),
(info['name'], True),
(info['applicant'], True),
(info['owner'], True),
(info['email'], True),
(info['status'], False),
(info['appid'], False),
......@@ -190,8 +190,8 @@ def chain_info(chain_dict):
d = {
'projectid': str(chain),
'name': project.application.name if project else app.name,
'applicant': app.applicant.realname,
'email': app.applicant.email,
'owner': app.owner.realname,
'email': app.owner.email,
'status': status,
'appid': appid,
}
......
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