Skip to content
Snippets Groups Projects

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

Merged L. Ellenbeck requested to merge Issues/0028-maxQuotaFix into Sprint/2021-19
2 files
+ 21
7
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -570,7 +570,21 @@ 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 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 +635,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 +723,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 +752,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 +809,7 @@ namespace Coscine.Api.Project.Controllers
return false;
}
}
private void LogAnalyticsViewHome(List<string> projectIds)
{
_coscineLogger.AnalyticsLog(
Loading