Checkpoint: Added docs, improved ExchangeEntity

This commit is contained in:
2021-01-06 17:12:20 +01:00
parent b633d2c2df
commit 90f154f23b
3 changed files with 8 additions and 3 deletions

View File

@ -69,9 +69,8 @@ public class ExchangeController extends TokenBasedController{
final Assignment assignmentInstance = assignment.get();
final Groups groupInstance = group.get();
final Optional<Exchange> exchangeInstance = this.exchangeService.checkForExchange(assignmentInstance, groupInstance);
if(!(assignmentInstance.getCommision().getCommisionOwner().getId() == asker.getId() && assignmentInstance.isAccepted() && exchangeInstance.isEmpty())){
if(!(assignmentInstance.getCommision().getCommisionOwner().getId().equals(asker.getId()) && assignmentInstance.isAccepted())){
return new ResponseEntity<>("Some of problems appeared. Check if you have access to given assignment and if it is accepted or the exchange has not been already added.", HttpStatus.BAD_REQUEST);
}