Commit 930feb51 authored by L. Ellenbeck's avatar L. Ellenbeck
Browse files

Update: Correct max quota on project creation rpdm/issues#28

parent 4981f221
......@@ -570,7 +570,22 @@ namespace Coscine.Api.Project.Controllers
return Unauthorized("User is not allowed to create SubProjects.");
}
var project = _projectModel.StoreFromObject(projectObject, user, _rdfStoreConnector.GetQuotaDefault(user.Id.ToString()));
//var defaultQuotas = _rdfStoreConnector.GetQuotaDefault(user.Id.ToString());
var defaultQuotas = _rdfStoreConnector.GetQuotaDefault("224fee26-931c-4acd-83de-65eeb39bce78");
var projectQuotas = defaultQuotas.Select(defaulQuota =>
{
var resourceType = _resourceTypeModel.GetWhere(resourceType => resourceType.DisplayName == defaulQuota.ResourceType);
return new ProjectQuota
{
MaxQuota = defaulQuota.DefaultMaxQuota,
Quota = defaulQuota.DefaultQuota,
ResourceTypeId = resourceType.Id
};
});
var project = _projectModel.StoreFromObject(projectObject, user, projectQuotas);
if (projectObject.ParentId != new Guid()
// Both an owner and a member can add subprojects to projects
......@@ -621,7 +636,7 @@ namespace Coscine.Api.Project.Controllers
Issuer = x.Issuer,
ProjectId = x.Project,
RoleId = x.Role,
UserMail = x.InviteeEmail
UserMail = x.InviteeEmail
});
return new ActionResult<IEnumerable<InvitationReturnObject>>(invitations);
......@@ -709,7 +724,7 @@ namespace Coscine.Api.Project.Controllers
{
var invitation = _invitationModel.GetById(invitationId);
if(invitation == null)
if (invitation == null)
{
return NotFound("Invitation was not found.");
}
......@@ -738,7 +753,7 @@ namespace Coscine.Api.Project.Controllers
var invitation = _invitationModel.GetByToken(token);
if(invitation == null)
if (invitation == null)
{
return NotFound("Invitation was not found.");
}
......@@ -795,7 +810,7 @@ namespace Coscine.Api.Project.Controllers
return false;
}
}
private void LogAnalyticsViewHome(List<string> projectIds)
{
_coscineLogger.AnalyticsLog(
......
......@@ -19,9 +19,9 @@
<ItemGroup>
<PackageReference Include="Coscine.Action" Version="2.*-*" />
<PackageReference Include="Coscine.ApiCommons" Version="2.*-*" />
<PackageReference Include="Coscine.Database" Version="2.*-*" />
<PackageReference Include="Coscine.Database" Version="2.6.0-issues-0028-maxq0002" />
<PackageReference Include="Coscine.Logging" Version="2.*-*" />
<PackageReference Include="Coscine.Metadata" Version="2.*-*" />
<PackageReference Include="Coscine.Metadata" Version="2.3.0-issues-0028-maxq0002" />
<PackageReference Include="Coscine.ResourceLoader" Version="2.*-*" />
<PackageReference Include="Coscine.ResourceTypeBase" Version="2.*-*" />
</ItemGroup>
......
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