Commit e6291dc5 authored by L. Ellenbeck's avatar L. Ellenbeck
Browse files

check for adjustable flag coscine/issues#1568

parent e1168fa9
......@@ -375,9 +375,16 @@ namespace Coscine.Api.Project.Controllers
return NotFound($"Could not find resourceType with id: {resourceTypeId}");
}
if (resourceType.DisplayName.Equals("rdss3"))
var resourceTypeDefinition = ResourceTypeFactory.CreateResourceTypeObject(resourceType.DisplayName, _configuration);
if (resourceTypeDefinition == null)
{
return BadRequest($"No provider for: \"{resourceType.DisplayName}\".");
}
if (!resourceTypeDefinition.GetResourceTypeInformation().Result.IsQuotaAdjustable)
{
return BadRequest($"Cannot adjust quota for rdss3.");
return BadRequest($"Cannot adjust quota for {resourceType.DisplayName}.");
}
if (updateProjectQuotaObject.Allocated < 0)
......
......@@ -23,5 +23,6 @@
<PackageReference Include="Coscine.Logging" Version="2.*-*" />
<PackageReference Include="Coscine.Metadata" Version="2.*-*" />
<PackageReference Include="Coscine.ResourceLoader" Version="2.*-*" />
<PackageReference Include="Coscine.ResourceTypeBase" Version="2.*-*" />
</ItemGroup>
</Project>
\ No newline at end of file
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