Compare commits

...

5 Commits

8 changed files with 19 additions and 14 deletions

View File

@ -1 +1 @@
1.7.0.6 1.7.0.7

View File

@ -8,8 +8,8 @@
<SignAssembly>True</SignAssembly> <SignAssembly>True</SignAssembly>
<StartupObject>BreCalClient.App</StartupObject> <StartupObject>BreCalClient.App</StartupObject>
<AssemblyOriginatorKeyFile>..\..\misc\brecal.snk</AssemblyOriginatorKeyFile> <AssemblyOriginatorKeyFile>..\..\misc\brecal.snk</AssemblyOriginatorKeyFile>
<AssemblyVersion>1.7.0.6</AssemblyVersion> <AssemblyVersion>1.7.0.7</AssemblyVersion>
<FileVersion>1.7.0.6</FileVersion> <FileVersion>1.7.0.7</FileVersion>
<Title>Bremen calling client</Title> <Title>Bremen calling client</Title>
<Description>A Windows WPF client for the Bremen calling API.</Description> <Description>A Windows WPF client for the Bremen calling API.</Description>
<ApplicationIcon>containership.ico</ApplicationIcon> <ApplicationIcon>containership.ico</ApplicationIcon>

View File

@ -260,8 +260,8 @@ namespace BreCalClient
else else
{ {
this.rowt1.Height = new(0); this.rowt1.Height = new(0);
this.rowt1.Height = new(0); this.rowt2.Height = new(0);
this.rowt1.Height = new(0); this.rowt3.Height = new(0);
} }
this.SetLockButton(this.Times.EtaBerthFixed ?? false); this.SetLockButton(this.Times.EtaBerthFixed ?? false);

View File

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<ApplicationRevision>1</ApplicationRevision> <ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.7.0.6</ApplicationVersion> <ApplicationVersion>1.7.0.7</ApplicationVersion>
<BootstrapperEnabled>True</BootstrapperEnabled> <BootstrapperEnabled>True</BootstrapperEnabled>
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<CreateDesktopShortcut>True</CreateDesktopShortcut> <CreateDesktopShortcut>True</CreateDesktopShortcut>
@ -38,7 +38,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<UpdateMode>Foreground</UpdateMode> <UpdateMode>Foreground</UpdateMode>
<UpdateRequired>True</UpdateRequired> <UpdateRequired>True</UpdateRequired>
<WebPageFileName>Publish.html</WebPageFileName> <WebPageFileName>Publish.html</WebPageFileName>
<MinimumRequiredVersion>1.7.0.6</MinimumRequiredVersion> <MinimumRequiredVersion>1.7.0.7</MinimumRequiredVersion>
<SkipPublishVerification>false</SkipPublishVerification> <SkipPublishVerification>false</SkipPublishVerification>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<ApplicationRevision>5</ApplicationRevision> <ApplicationRevision>5</ApplicationRevision>
<ApplicationVersion>1.7.0.6</ApplicationVersion> <ApplicationVersion>1.7.0.7</ApplicationVersion>
<BootstrapperEnabled>True</BootstrapperEnabled> <BootstrapperEnabled>True</BootstrapperEnabled>
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<CreateDesktopShortcut>True</CreateDesktopShortcut> <CreateDesktopShortcut>True</CreateDesktopShortcut>
@ -41,7 +41,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PublishDir>bin\Debug\net8.0-windows7.0\win-x64\app.publish\</PublishDir> <PublishDir>bin\Debug\net8.0-windows7.0\win-x64\app.publish\</PublishDir>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SkipPublishVerification>false</SkipPublishVerification> <SkipPublishVerification>false</SkipPublishVerification>
<MinimumRequiredVersion>1.7.0.6</MinimumRequiredVersion> <MinimumRequiredVersion>1.7.0.7</MinimumRequiredVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PublishFile Include="containership.ico"> <PublishFile Include="containership.ico">

View File

@ -6,8 +6,8 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<ApplicationIcon>Resources\lock_preferences.ico</ApplicationIcon> <ApplicationIcon>Resources\lock_preferences.ico</ApplicationIcon>
<FileVersion>1.7.0.6</FileVersion> <FileVersion>1.7.0.7</FileVersion>
<AssemblyVersion>1.7.0.6</AssemblyVersion> <AssemblyVersion>1.7.0.7</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -579,8 +579,9 @@ class User:
def __hash__(self): def __hash__(self):
return hash(id) return hash(id)
def wants_notification(self, notification_type: NotificationType): def wants_notifications(self, notification_type: NotificationType):
return notification_type in self.notify_event events = bitflag_to_list(self.notify_event)
return notification_type in events
@dataclass @dataclass
class Ship: class Ship:

View File

@ -548,12 +548,16 @@ class InputValidationShipcall():
assigned_agency = get_assigned_participant_of_type(shipcall_id, participant_type=ParticipantType.AGENCY) assigned_agency = get_assigned_participant_of_type(shipcall_id, participant_type=ParticipantType.AGENCY)
assigned_pilot = get_assigned_participant_of_type(shipcall_id, participant_type=ParticipantType.PILOT) assigned_pilot = get_assigned_participant_of_type(shipcall_id, participant_type=ParticipantType.PILOT)
an_agency_is_assigned = True if assigned_agency is not None else False an_agency_is_assigned = True if assigned_agency is not None else False
a_pilot_is_assigned = True if assigned_pilot is not None else False
else: else:
# Agency assigned? User must belong to the assigned agency or be a BSMD user, in case the flag is set # Agency assigned? User must belong to the assigned agency or be a BSMD user, in case the flag is set
assigned_agency = [spm for spm in shipcall_participant_map if int(spm.type) == int(ParticipantType.AGENCY)] assigned_agency = [spm for spm in shipcall_participant_map if int(spm.type) == int(ParticipantType.AGENCY)]
assigned_pilot = [spm for spm in shipcall_participant_map if int(spm.type) == int(ParticipantType.PILOT)] assigned_pilot = [spm for spm in shipcall_participant_map if int(spm.type) == int(ParticipantType.PILOT)]
an_agency_is_assigned = len(assigned_agency)==1 an_agency_is_assigned = len(assigned_agency)==1
a_pilot_is_assigned = len(assigned_pilot)==1
if a_pilot_is_assigned:
assigned_pilot = assigned_pilot[0]
if len(assigned_agency)>1: if len(assigned_agency)>1:
raise ValidationError({"internal_error":f"Internal error? Found more than one assigned agency for the shipcall with ID {shipcall_id}. Found: {assigned_agency}"}) raise ValidationError({"internal_error":f"Internal error? Found more than one assigned agency for the shipcall with ID {shipcall_id}. Found: {assigned_agency}"})
@ -569,7 +573,7 @@ class InputValidationShipcall():
### USER authority ### ### USER authority ###
# determine, whether the user is a) the assigned agency or b) a BSMD participant # determine, whether the user is a) the assigned agency or b) a BSMD participant
user_is_assigned_agency = (user_participant_id == assigned_agency.id) user_is_assigned_agency = (user_participant_id == assigned_agency.id)
user_is_assigned_pilot = (user_participant_id == assigned_pilot.id) user_is_assigned_pilot = a_pilot_is_assigned and (user_participant_id == assigned_pilot.id)
# when the BSMD flag is set: the user must be either BSMD or the assigned agency # when the BSMD flag is set: the user must be either BSMD or the assigned agency
# when the BSMD flag is not set: the user must be the assigned agency # when the BSMD flag is not set: the user must be the assigned agency